Skip to content

Commit

Permalink
Merge pull request #23 from tobifroe/sonar-fixes
Browse files Browse the repository at this point in the history
fix: various code quality issues
  • Loading branch information
tobifroe authored Oct 27, 2024
2 parents f6a09ee + 0b5787e commit 3e615c3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM golang:alpine

RUN apk add make
RUN apk --no-cache add make

WORKDIR /app

COPY . /app

RUN make build-docker

ENTRYPOINT ["./starscraper"]
ENTRYPOINT ["./starscraper"]
4 changes: 0 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,3 @@ func Execute() {
os.Exit(1)
}
}

func init() {

}
8 changes: 5 additions & 3 deletions util/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import (
"github.com/tobifroe/starscraper/types"
)

const outfile = "output.csv"

func TestWriteToCSV(t *testing.T) {
// Mock data for testing
users := []types.User{
Expand All @@ -20,10 +22,10 @@ func TestWriteToCSV(t *testing.T) {
}

// Execute the function
WriteToCSV(users, "output.csv")
WriteToCSV(users, outfile)

// Read the written file
file, err := os.Open("output.csv")
file, err := os.Open(outfile)
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -80,7 +82,7 @@ func TestMain(m *testing.M) {
exitVal := m.Run()

// Clean up after tests
err := os.Remove("output.csv")
err := os.Remove(outfile)
if err != nil {
panic(err)
}
Expand Down

0 comments on commit 3e615c3

Please sign in to comment.