GH-28752 fix errcheck lint issues in server/channels/testlib/helper.go (#29260)

This commit is contained in:
mas-who 2024-11-14 14:13:45 +02:00 committed by GitHub
parent 18c5fe8f6a
commit f48fd7b791
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 4 deletions

View file

@ -203,7 +203,6 @@ issues:
channels/store/storetest/team_store.go|\
channels/store/storetest/thread_store.go|\
channels/store/storetest/user_store.go|\
channels/testlib/helper.go|\
channels/utils/license_test.go|\
channels/web/oauth_test.go|\
channels/web/saml.go|\

View file

@ -73,10 +73,16 @@ func NewMainHelperWithOptions(options *HelperOptions) *MainHelper {
Logger: logger,
}
mlog.NewLogger()
_, err := mlog.NewLogger()
if err != nil {
log.Fatal(err)
}
flag.Parse()
utils.TranslationsPreInit()
err = utils.TranslationsPreInit()
if err != nil {
log.Fatal(err)
}
if options != nil {
if options.EnableStore && !testing.Short() {
@ -92,7 +98,13 @@ func NewMainHelperWithOptions(options *HelperOptions) *MainHelper {
}
func (h *MainHelper) Main(m *testing.M) {
defer h.Logger.Shutdown()
defer func() {
err := h.Logger.Shutdown()
if err != nil {
log.Fatal(err)
}
}()
if h.testResourcePath != "" {
prevDir, err := os.Getwd()
if err != nil {