Skip to content

Commit

Permalink
refactor: Removing useless errcheck for parse flag
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Apr 23, 2024
1 parent de50976 commit 6257886
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 4 additions & 2 deletions cmd/fibr/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type configuration struct {
disableAuth bool
}

func newConfig() (configuration, error) {
func newConfig() configuration {
fs := flag.NewFlagSet("fibr", flag.ExitOnError)
fs.Usage = flags.Usage(fs)

Expand Down Expand Up @@ -80,5 +80,7 @@ func newConfig() (configuration, error) {

flags.New("NoAuth", "Disable basic authentification").DocPrefix("auth").BoolVar(fs, &config.disableAuth, false, nil)

return config, fs.Parse(os.Args[1:])
_ = fs.Parse(os.Args[1:])

return config
}
7 changes: 1 addition & 6 deletions cmd/fibr/fibr.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"embed"
"fmt"
"log"
"log/slog"
"net/http"
"os"
Expand Down Expand Up @@ -39,11 +38,7 @@ func newLoginService(tracerProvider trace.TracerProvider, basicConfig *basicMemo
}

func main() {
config, err := newConfig()
if err != nil {
log.Fatal(fmt.Errorf("config: %s", err))
}

config := newConfig()
alcotest.DoAndExit(config.alcotest)

go func() {
Expand Down

0 comments on commit 6257886

Please sign in to comment.