Skip to content

Commit

Permalink
Remove log package from main
Browse files Browse the repository at this point in the history
We don't need it yet
  • Loading branch information
Ajnasz committed Jul 20, 2021
1 parent def44c5 commit a52c5fb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"flag"
"fmt"
"log"
"net/http"
"net/url"
"os"
Expand Down Expand Up @@ -74,7 +73,7 @@ type HandlerConfig struct {

func listen(handlerConfig HandlerConfig) *http.Server {
apiRoot := getAPIRoot(handlerConfig.WebExternalURL)
log.Println("Handle Path: ", apiRoot)
fmt.Println("Handle Path: ", apiRoot)

r := http.NewServeMux()
r.Handle(apiRoot, http.StripPrefix(apiRoot, NewSecretHandler(handlerConfig)))
Expand All @@ -88,7 +87,8 @@ func listen(handlerConfig HandlerConfig) *http.Server {
go func() {
if err := httpServer.ListenAndServe(); err != nil {
if err.Error() != "http: Server closed" {
log.Fatal(err)
fmt.Fprintf(os.Stderr, "error: %s", err)
os.Exit(1)
}
}
}()
Expand Down Expand Up @@ -166,7 +166,8 @@ func main() {
handlerConfig, err := getConfig()

if err != nil {
log.Fatal(err)
fmt.Fprintf(os.Stderr, "error: %s", err)
os.Exit(1)
}

stopChan := make(chan interface{})
Expand All @@ -193,7 +194,8 @@ func main() {

for err := range c {
if err != nil {
log.Fatal(err)
fmt.Fprintf(os.Stderr, "error: %s", err)
os.Exit(1)
}
}

Expand Down

0 comments on commit a52c5fb

Please sign in to comment.