Skip to content

Commit

Permalink
Add GitHub Actions, fix a lint
Browse files Browse the repository at this point in the history
  • Loading branch information
justinas committed Apr 6, 2024
1 parent 48ce7d5 commit 56ac5b6
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Lint
on: [push, pull_request]
jobs:
lint:
strategy:
matrix:
go:
- stable
- oldstable
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
21 changes: 21 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Test
on: [push, pull_request]
jobs:
lint:
strategy:
matrix:
go:
- stable
- oldstable
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Setup Go ${{ matrix.go }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go }}

- name: Run tests
run: go test -v ./...
4 changes: 2 additions & 2 deletions chain_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
func tagMiddleware(tag string) Constructor {
return func(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(tag))
_, _ = w.Write([]byte(tag))
h.ServeHTTP(w, r)
})
}
Expand All @@ -29,7 +29,7 @@ func funcsEqual(f1, f2 interface{}) bool {
}

var testApp = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("app\n"))
_, _ = w.Write([]byte("app\n"))
})

func TestNew(t *testing.T) {
Expand Down

0 comments on commit 56ac5b6

Please sign in to comment.