Skip to content

Commit

Permalink
chore: update to go v1.22 and other deps and fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
plastikfan committed Apr 26, 2024
1 parent ba40f4b commit 157570a
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 16 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
go-version: 1.22
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
version: v1.52.2
version: v1.56.2
args: --verbose

test:
Expand Down
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,4 @@ linters:

run:
issues-exit-code: 1
timeout: "5m"
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
],
"cSpell.words": [
"bodyclose",
"cobrass",
"cubiest",
"deadcode",
"depguard",
Expand All @@ -20,6 +21,7 @@
"gocyclo",
"gofmt",
"goimports",
"gomega",
"gomnd",
"gosec",
"gosimple",
Expand All @@ -34,13 +36,15 @@
"nakedret",
"nolint",
"nolintlint",
"onsi",
"pixa",
"prealloc",
"repotoken",
"resq",
"sidewalk",
"skeletor",
"smaug",
"snivilised",
"staticcheck",
"structcheck",
"stylecheck",
Expand Down
3 changes: 1 addition & 2 deletions src/app/command/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,7 @@ func (b *Bootstrap) configure(options ...ConfigureOptionFn) {
//
viper.AddConfigPath(home)
viper.SetConfigType("yaml")
configName := fmt.Sprintf("%v.yml", ApplicationName)
viper.SetConfigName(configName)
viper.SetConfigName(fmt.Sprintf("%v.yml", ApplicationName))
}

viper.AutomaticEnv() // read in environment variables that match
Expand Down
4 changes: 2 additions & 2 deletions src/app/command/bootstrap_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package command_test

import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/ginkgo/v2" //nolint:revive // ginkgo ok
. "github.com/onsi/gomega" //nolint:revive // gomega ok
"github.com/snivilised/extendio/xfs/utils"
"github.com/snivilised/scorpio/src/app/command"
"github.com/snivilised/scorpio/src/internal/helpers"
Expand Down
4 changes: 2 additions & 2 deletions src/app/command/command_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package command_test
import (
"testing"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/ginkgo/v2" //nolint:revive // ginkgo ok
. "github.com/onsi/gomega" //nolint:revive // gomega ok
)

func TestCommand(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/command/pool-cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func buildPoolCommand(container *assistant.CobraContainer) *cobra.Command {

// optionally invoke cross field validation
//
if xv := ps.CrossValidate(func(ps *react.PoolParameterSet) error {
if xv := ps.CrossValidate(func(_ *react.PoolParameterSet) error {
return nil
}); xv == nil {
options := []string{}
Expand Down
4 changes: 2 additions & 2 deletions src/app/command/pool_cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package command_test
import (
"fmt"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/ginkgo/v2" //nolint:revive // ginkgo ok
. "github.com/onsi/gomega" //nolint:revive // gomega ok

xi18n "github.com/snivilised/extendio/i18n"
"github.com/snivilised/extendio/xfs/utils"
Expand Down
4 changes: 2 additions & 2 deletions src/app/command/root-cmd_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package command_test

import (
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/ginkgo/v2" //nolint:revive // ginkgo ok
. "github.com/onsi/gomega" //nolint:revive // gomega ok

"github.com/snivilised/extendio/xfs/utils"
"github.com/snivilised/scorpio/src/app/command"
Expand Down
2 changes: 1 addition & 1 deletion src/app/react/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (p *pipeline[I, O]) produce(
provider ProviderFn[I],
jobChSize int,
) {
p.cancel = func(ctx context.Context, delay time.Duration, cancellations ...context.CancelFunc) {
p.cancel = func(_ context.Context, delay time.Duration, cancellations ...context.CancelFunc) {
go CancelProducerAfter[I, O](
delay,
cancellations...,
Expand Down
1 change: 1 addition & 0 deletions src/app/react/pool-entry-point.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ func EnterPool(ps *PoolParameterSet) error {
pipe.produce(ctx, func() TestJobInput {
recipient := rand.Intn(len(audience)) //nolint:gosec // trivial
sequence++

return TestJobInput{
sequenceNo: sequence,
Recipient: audience[recipient],
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/i18n_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package i18n_test
import (
"testing"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
. "github.com/onsi/ginkgo/v2" //nolint:revive // ginkgo ok
. "github.com/onsi/gomega" //nolint:revive // gomega ok
)

func TestI18n(t *testing.T) {
Expand Down
2 changes: 2 additions & 0 deletions src/internal/log/new-logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func NewLogger(info *LoggerInfo) Ref {
if info.Path == "" {
panic(i18n.NewInvalidConfigEntryError(info.Path, "-"))
}

ws := zapcore.AddSync(&lumberjack.Logger{
Filename: info.Path,
MaxSize: info.Rotation.MaxSizeInMb,
Expand All @@ -29,6 +30,7 @@ func NewLogger(info *LoggerInfo) Ref {
ws,
info.Level,
)

return zap.New(core)
}, func() Logger {
return zap.NewNop()
Expand Down

0 comments on commit 157570a

Please sign in to comment.