Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
streamer45 committed Feb 19, 2025
1 parent cf5f62f commit 18dd69c
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.61.0
version: v1.64.5
29 changes: 4 additions & 25 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,10 @@ linters-settings:
gofmt:
simplify: true
govet:
check-shadowing: false # set this to true from time to time to check for possible issues
disable-all: true
enable:
- asmdecl # report mismatches between assembly files and Go declarations
- assign # check for useless assignments
- atomic # check for common mistakes using the sync/atomic package
- bools # check for common mistakes involving boolean operators
- buildtag # check that +build tags are well-formed and correctly located
- cgocall # detect some violations of the cgo pointer passing rules
- composites # check for unkeyed composite literals
- copylocks # check for locks erroneously passed by value
- errorsas # report passing non-pointer or non-error values to errors.As
- httpresponse # check for mistakes using HTTP responses
- loopclosure # check references to loop variables from within nested functions
- lostcancel # check cancel func returned by context.WithCancel is called
- nilfunc # check for useless comparisons between functions and nil
- printf # check consistency of Printf format strings and arguments
- shift # check for shifts that equal or exceed the width of the integer
- stdmethods # check signature of methods of well-known interfaces
- structtag # check that struct field tags conform to reflect.StructTag.Get
- tests # check for common mistaken usages of tests and examples
- unmarshal # report passing non-pointer or non-interface values to unmarshal
- unreachable # check for unreachable code
- unsafeptr # check for invalid conversions of uintptr to unsafe.Pointer
- unusedresult # check for unused results of calls to some functions
enable-all: true
disable:
- fieldalignment
- shadow

linters:
disable-all: true
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ DOCKER_USER ?= user
DOCKER_PASSWORD ?= password
## Docker Images
DOCKER_IMAGE_GO += "golang:${GO_VERSION}"
DOCKER_IMAGE_GOLINT += "golangci/golangci-lint:v1.60.0@sha256:e47065d755ca0afeac9df866d1dabdc99f439653a43fe234e05f50d9c36b6b90"
DOCKER_IMAGE_GOLINT += "golangci/golangci-lint:v1.64.5@sha256:9faef4dda4304c4790a14c5b8c8cd8c2715a8cb754e13f61d8ceaa358f5a454a"
DOCKER_IMAGE_DOCKERLINT += "hadolint/hadolint:v2.12.0@sha256:9259e253a4e299b50c92006149dd3a171c7ea3c5bd36f060022b5d2c1ff0fbbe"
DOCKER_IMAGE_COSIGN += "bitnami/cosign:1.8.0@sha256:8c2c61c546258fffff18b47bb82a65af6142007306b737129a7bd5429d53629a"
DOCKER_IMAGE_GH_CLI += "ghcr.io/supportpal/github-gh-cli:2.31.0@sha256:71371e36e62bd24ddd42d9e4c720a7e9954cb599475e24d1407af7190e2a5685"
Expand Down
6 changes: 2 additions & 4 deletions service/auth/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import (

const MinKeyLen = 32

var (
ErrAlreadyRegistered = errors.New("registration failed: already registered")
)
var ErrAlreadyRegistered = errors.New("registration failed: already registered")

type Service struct {
sessionCache *SessionCache
Expand Down Expand Up @@ -52,7 +50,7 @@ func (s *Service) Register(id, key string) error {

if _, err := s.store.Get(id); err == nil {
return ErrAlreadyRegistered
} else if err != nil && !errors.Is(err, store.ErrNotFound) {
} else if !errors.Is(err, store.ErrNotFound) {
return fmt.Errorf("registration failed: %w", err)
}

Expand Down
6 changes: 0 additions & 6 deletions service/jobs_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,11 +224,5 @@ func (s *Service) handleInit(w http.ResponseWriter, r *http.Request) {
return
}

if err != nil {
data.err = "failed to create recording job: " + err.Error()
data.code = http.StatusInternalServerError
return
}

data.code = http.StatusOK
}

0 comments on commit 18dd69c

Please sign in to comment.