Skip to content

Commit

Permalink
Remove not yet initialized logger usage and redundant os.Exit
Browse files Browse the repository at this point in the history
  • Loading branch information
ma-hartma committed Dec 9, 2021
1 parent acca8e5 commit 0dd39cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions cmd/knoxite/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,10 @@ func (l *Logger) WithWriter(w io.Writer) *Logger {

func (l Logger) Fatal(v ...interface{}) {
l.log(knoxite.LogLevelFatal, v...)
os.Exit(1)
}

func (l Logger) Fatalf(format string, v ...interface{}) {
l.logf(knoxite.LogLevelFatal, format, v...)
os.Exit(1)
}

func (l Logger) Warn(v ...interface{}) {
Expand Down
5 changes: 3 additions & 2 deletions cmd/knoxite/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
package main

import (
"fmt"
"os"
"syscall"

shutdown "github.com/klauspost/shutdown2"
"github.com/spf13/cobra"
"github.com/rsteube/carapace"
"github.com/spf13/cobra"

"github.com/knoxite/knoxite"
"github.com/knoxite/knoxite/cmd/knoxite/config"
Expand Down Expand Up @@ -84,7 +85,7 @@ func main() {
carapace.Gen(RootCmd)

if err := RootCmd.Execute(); err != nil {
log.Fatal(err)
fmt.Println(err)
os.Exit(-1)
}
}
Expand Down

0 comments on commit 0dd39cd

Please sign in to comment.