If you mean the code that never wraps anything and just does “return
err”, then it could actually be better off using panics. In fact, it's
documented in Effective Go. If all you return in your API is
a simple opaque “shit's broken, yo” error, then it is a perfectly valid
approach to use panics. As long as they are in your package's insides,
and as long as you return an error on the external border of your API
instead of making users handle your panics.