You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
after a return on a main function
defer Logger.Sync() is called and panic SIGFAULT is raised
To Reproduce
...
Expected behavior
Just close the program without panic segfault
after I removed defer env.Logger.Sync() it works cool Additional context
func main() {
defer env.Logger.Sync()
var err error
env.Logger, err = zap.NewProduction()
if err != nil {
log.Fatalf("could not create zap logger: %v", err)
}
zap.ReplaceGlobals(env.Logger)
if !service.functionThatReturnFalse(){
//when return is hit the program segfault !
return
}
Some implementation code is removed .....
router.Run(":" + port)
}
The text was updated successfully, but these errors were encountered:
Describe the bug
after a return on a main function
defer Logger.Sync() is called and panic SIGFAULT is raised
To Reproduce
...
Expected behavior
Just close the program without panic segfault
after I removed defer env.Logger.Sync() it works cool
Additional context
func main() {
defer env.Logger.Sync()
}
The text was updated successfully, but these errors were encountered: