Skip to content

Commit

Permalink
Fix lint (#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
zliang-akamai authored Nov 7, 2024
1 parent 4c3fcf0 commit f20d5f2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 15 deletions.
16 changes: 4 additions & 12 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ linters:
enable-all: true
disable:
# deprecated linters
- deadcode
- ifshort
- varcheck
- nosnakecase
- execinquery
- exportloopref
####################

# conflicted with go fmt
Expand All @@ -35,24 +33,21 @@ linters:
# workaround to avoid linter failures of getting malformed json
- musttag

- err113

- bodyclose
- contextcheck
- nilerr
- noctx
- rowserrcheck
- sqlclosecheck
- structcheck
- tparallel
- vetshadow
- errname
- forcetypeassert
- gocyclo
- unparam
- nakedret
- lll
- golint
- maligned
- scopelint
- dupl
- gosec
- gochecknoinits
Expand All @@ -63,15 +58,12 @@ linters:
- staticcheck
- stylecheck
- wsl
- interfacer
- varnamelen
- tagliatelle
- gomnd
- nlreturn
- wrapcheck
- wastedassign
- goerr113
- exhaustivestruct
- durationcheck
- errorlint
- cyclop
Expand Down
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -794,7 +794,7 @@ func NewClientFromEnv(hc *http.Client) (*Client, error) {
client.selectedProfile = configProfile

// We should only load the config if the config file exists
if _, err := os.Stat(configPath); err != nil {
if _, err = os.Stat(configPath); err != nil {
return nil, fmt.Errorf("error loading config file %s: %w", configPath, err)
}

Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ func resolveValidConfigPath() (string, error) {
return "", err
}

if _, err := os.Stat(p); err != nil {
if _, err = os.Stat(p); err != nil {
continue
}

Expand Down
2 changes: 1 addition & 1 deletion waitfor.go
Original file line number Diff line number Diff line change
Expand Up @@ -739,7 +739,7 @@ func (p *EventPoller) WaitForFinished(
for {
select {
case <-ticker.C:
event, err := p.client.GetEvent(ctx, event.ID)
event, err = p.client.GetEvent(ctx, event.ID)
if err != nil {
return nil, fmt.Errorf("failed to get event: %w", err)
}
Expand Down

0 comments on commit f20d5f2

Please sign in to comment.