Skip to content

Commit 4fc9f29

Browse files
committed
chore: update linter and fix new warnings
1 parent 947630e commit 4fc9f29

File tree

21 files changed

+33
-109
lines changed

21 files changed

+33
-109
lines changed

engine/.golangci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ linters-settings:
6666

6767
linters:
6868
enable:
69-
- deadcode
7069
- depguard
7170
- dupl
7271
- errcheck
@@ -83,10 +82,8 @@ linters:
8382
- misspell
8483
- prealloc
8584
- revive
86-
- structcheck
8785
- stylecheck
8886
- unconvert
89-
- varcheck
9087
- unused
9188
- unparam
9289
- wsl

engine/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ help: ## Display the help message
3434
all: clean build ## Build all binary components of the project
3535

3636
install-lint: ## Install the linter to $GOPATH/bin which is expected to be in $PATH
37-
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.2
37+
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.52.2
3838

3939
run-lint: ## Run linters
4040
golangci-lint run

engine/cmd/cli/commands/clone/actions.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -402,11 +402,7 @@ func forward(cliCtx *cli.Context) error {
402402

403403
log.Msg(fmt.Sprintf("The clone is available by address: %s", tunnel.Endpoints.Local))
404404

405-
if err := tunnel.Listen(cliCtx.Context); err != nil {
406-
return err
407-
}
408-
409-
return nil
405+
return tunnel.Listen(cliCtx.Context)
410406
}
411407

412408
func retrieveClonePort(cliCtx *cli.Context, wg *sync.WaitGroup, remoteHost *url.URL) (string, error) {

engine/cmd/cli/commands/clone/command_list.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,7 @@ func CommandList() []*cli.Command {
225225
return err
226226
}
227227

228-
if err := commands.CheckForwardingServerURL(ctxCli); err != nil {
229-
return err
230-
}
231-
232-
return nil
228+
return commands.CheckForwardingServerURL(ctxCli)
233229
},
234230
Action: forward,
235231
},

engine/cmd/cli/commands/config/file.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,5 @@ func SaveConfig(filename string, cfg *CLIConfig) error {
7777
return err
7878
}
7979

80-
if err := os.WriteFile(filename, configData, 0600); err != nil {
81-
return err
82-
}
83-
84-
return nil
80+
return os.WriteFile(filename, configData, 0600)
8581
}

engine/cmd/cli/commands/global/actions.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,5 @@ func forward(cliCtx *cli.Context) error {
7777

7878
log.Msg(fmt.Sprintf("The connection is available by address: %s", tunnel.Endpoints.Local))
7979

80-
if err := tunnel.Listen(cliCtx.Context); err != nil {
81-
return err
82-
}
83-
84-
return nil
80+
return tunnel.Listen(cliCtx.Context)
8581
}

engine/cmd/cli/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package main contains the starting point of the CLI tool.
12
package main
23

34
import (

engine/cmd/database-lab/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
// - Validate configs in all components.
77
// - Tests.
88

9+
// Package main contains the starting point of the DLE server.
910
package main
1011

1112
import (

engine/cmd/runci/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package main contains the starting point of the CI Checker tool.
12
package main
23

34
import (

engine/internal/billing/billing.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,7 @@ func (b *Billing) RegisterInstance(ctx context.Context, systemMetrics models.Sys
8686
}
8787

8888
// To check billing state immediately.
89-
if err := b.SendUsage(ctx, systemMetrics); err != nil {
90-
return err
91-
}
92-
93-
return nil
89+
return b.SendUsage(ctx, systemMetrics)
9490
}
9591

9692
// CollectUsage periodically collects usage statistics of the instance.

0 commit comments

Comments
 (0)