Skip to content

Commit

Permalink
verify/ci: upgrade golangci-lint (#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
calebdoxsey authored Dec 14, 2023
1 parent 7881e9b commit 38a1b48
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Lint
permissions:
contents: read
on:
push:
branches:
- main
pull_request: {}

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
with:
fetch-depth: 0

- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe
with:
go-version: 1.21.x
cache: false

- uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc
with:
version: v1.55
args: --timeout=10m
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,9 @@ yarn:
test:
@echo "==> $@"
go test -v ./...

.PHONY: lint
lint:
@echo "@==> $@"
@VERSION=$$(go run github.com/mikefarah/yq/[email protected] '.jobs.lint.steps[] | select(.uses == "golangci/golangci-lint-action*") | .with.version' .github/workflows/lint.yml) && \
go run github.com/golangci/golangci-lint/cmd/golangci-lint@$$VERSION run ./...
4 changes: 2 additions & 2 deletions http.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (srv *Server) initRouter() {

func (srv *Server) serveHeaders(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(r.Header)
_ = json.NewEncoder(w).Encode(r.Header)
}

func (srv *Server) serveStatic(w http.ResponseWriter, r *http.Request, name, etag string) {
Expand Down Expand Up @@ -187,7 +187,7 @@ func (srv *Server) serveAPIVerifyInfo(w http.ResponseWriter, r *http.Request) {
"tlsError": tlsErrStr,
}
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(res)
_ = json.NewEncoder(w).Encode(res)
}

func getUnverifiedIdentity(r *http.Request) *sdk.Identity {
Expand Down
3 changes: 2 additions & 1 deletion verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ func New(options ...Option) *Server {

// Run runs the server.
func (srv *Server) Run(ctx context.Context) error {
eg, ctx := errgroup.WithContext(ctx)

err := srv.init(ctx)
if err != nil {
return err
}

eg, ctx := errgroup.WithContext(ctx)
eg.Go(func() error {
log.Info().
Str("bind-addr", srv.cfg.bindAddress).
Expand Down

0 comments on commit 38a1b48

Please sign in to comment.