Skip to content

Commit

Permalink
Linting.
Browse files Browse the repository at this point in the history
  • Loading branch information
ibiscum committed Feb 16, 2024
1 parent 194aef0 commit f020a31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,17 @@ func main() {
if !os.IsNotExist((err)) {
os.Remove(*logFile)
}

csvFile, err := os.Open(*bankFile)
if err != nil {
fmt.Println("Error opening file: ", *bankFile)
os.Exit(1)
}
trxs := parseBankFile(csvFile, *logFile)
fmt.Println()
for _, trx := range trxs {
fmt.Printf("%v\n", trx)
}

fmt.Println()
for _, trx := range trxs {
fmt.Printf("%v\n", trx)
}
}

func parseBankFile(bankTransactions io.Reader, logFile string) []transaction {
Expand Down
6 changes: 5 additions & 1 deletion cmd/Chapter14/Exercise14.05/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ func (srv server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
auth := r.Header.Get("Authorization")
if auth != "superSecretToken" {
w.WriteHeader(http.StatusUnauthorized)
w.Write([]byte("Authorization token not recognized"))
_, err := w.Write([]byte("Authorization token not recognized"))
if err != nil {
log.Fatal(err)
}

return
}

Expand Down

0 comments on commit f020a31

Please sign in to comment.