Skip to content

Commit

Permalink
fix lint msg
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorPolyakov committed Aug 31, 2024
1 parent 20daab0 commit 14d6aff
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
6 changes: 5 additions & 1 deletion internal/app/handlers/avatar.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package handlers

import (
"log/slog"
"net/http"

"ctf01d/internal/app/server"
Expand All @@ -26,5 +27,8 @@ func (h *Handlers) UniqueAvatar(w http.ResponseWriter, r *http.Request, username
imageBytes := avatar.GenerateAvatar(username, xMax, yMax, blockSize, steps)

w.Header().Set("Content-Type", "image/png")
w.Write(imageBytes)
_, err := w.Write(imageBytes)
if err != nil {
slog.Warn(err.Error(), "handler", "UniqueAvatar ")
}
}
6 changes: 3 additions & 3 deletions scripts/create-migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ package main

import (
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"regexp"
"strconv"
)

func main() {
dir := "./internal/app/migrations/psql/"
files, err := ioutil.ReadDir(dir)
files, err := os.ReadDir(dir)
if err != nil {
log.Fatal(err)
}
Expand Down Expand Up @@ -64,7 +64,7 @@ func DatabaseUpdate_update%04d_update%04d(db *sql.DB, getInfo bool) (string, str
}
`, maxUpdate, nextUpdate)

err = ioutil.WriteFile(newFilePath, []byte(template), 0o644)
err = os.WriteFile(newFilePath, []byte(template), 0o644)
if err != nil {
log.Fatal(err)
}
Expand Down
7 changes: 6 additions & 1 deletion test/server_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ func TestMain(m *testing.M) {
if err != nil {
panic(err)
}
NewTestRouter()

_, err = NewTestRouter()
if err != nil {
panic(err)
}

code := m.Run()
db.Close()
os.Exit(code)
Expand Down

0 comments on commit 14d6aff

Please sign in to comment.