If I have func init() { ... } in several different files in the same package, and I log an error from one of them, the stacktrace seems to be put at the end of the last line in the init() that is declared in the last source file (sorted alphabetically). Although I could be wrong and this could be a coincidence in my case.
If I have
func init() { ... }
in several different files in the same package, and I log an error from one of them, the stacktrace seems to be put at the end of the last line in theinit()
that is declared in the last source file (sorted alphabetically). Although I could be wrong and this could be a coincidence in my case.According to the Go spec, what I'm doing is legal: https://golang.org/ref/spec#Package_initialization