Skip to content

Commit

Permalink
update/go-libs (#226)
Browse files Browse the repository at this point in the history
* update libs and fix lint

* restructure

* add missing file
  • Loading branch information
alexei-led committed Jan 9, 2023
1 parent cd6983d commit 3c9470f
Show file tree
Hide file tree
Showing 24 changed files with 944 additions and 1,012 deletions.
53 changes: 40 additions & 13 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
run:
# timeout for analysis
timeout: 10m
# which dirs to skip
skip-dirs:
- mocks
# Timeout for analysis, e.g. 30s, 5m.
# Default: 1m
timeout: 5m
# Exit code when at least one issue was found.
# Default: 1
issues-exit-code: 2
# Include test files or not.
# Default: true
tests: false
# allow parallel run
allow-parallel-runners: true

linters-settings:
govet:
Expand All @@ -13,12 +22,14 @@ linters-settings:
maligned:
suggest-new: true
dupl:
threshold: 150
threshold: 100
goconst:
min-len: 2
min-occurrences: 2
misspell:
locale: US
ignore-words:
- "cancelled"
goimports:
local-prefixes: github.com/golangci/golangci-lint
gocritic:
Expand Down Expand Up @@ -46,17 +57,24 @@ linters:
disable-all: true
enable:
- asciicheck
- bidichk
- bodyclose
- deadcode
# - containedctx
# - contextcheck disabled because of generics
- decorder
- depguard
- dogsled
- dupl
- durationcheck
- errcheck
- errchkjson
- errname
- errorlint
- exhaustive
# - exhaustivestruct TODO: check how to fix it
- exportloopref
# - forbidigo TODO: configure forbidden code patterns
# - forcetypeassert
- funlen
- gci
# - gochecknoglobals TODO: remove globals from code
Expand All @@ -70,34 +88,44 @@ linters:
- gofmt
- goimports
- gomnd
- gomoddirectives
# - gomoddirectives
- gosec
- gosimple
- govet
- goprintffuncname
- ifshort
- grouper
- importas
# - ireturn TODO: not sure if it is a good linter
- ineffassign
- interfacebloat
- loggercheck
- maintidx
- makezero
- misspell
- nakedret
# - nestif
- nilerr
- nilnil
# - noctx
- nolintlint
- prealloc
- predeclared
- promlinter
- reassign
- revive
- rowserrcheck
- staticcheck
- structcheck
# - rowserrcheck disabled because of generics
# - staticcheck doesn't work with go1.19
# - structcheck disabled because of generics
- stylecheck
- tenv
- testableexamples
- typecheck
- unconvert
- unparam
- unused
- varcheck
- wastedassign
# - varnamelen TODO: review naming
# - varcheck depricated 1.49
# - wastedassign disabled because of generics
- whitespace
- wrapcheck
# - wsl
Expand All @@ -112,7 +140,6 @@ issues:
- dupl
- gocognit
- goconst
- goerr113

- gocyclo
exclude:
- Using the variable on range scope `tt` in function literal
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ release: clean ; $(info $(M) building binaries for multiple os/arch...) @ ## Bui
setup-tools: setup-golangci-lint setup-gocov setup-gocov-xml setup-go2xunit

setup-golangci-lint:
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.42.1
$(GO) install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.50.1
setup-gocov:
$(GO) install github.com/axw/gocov/gocov@latest
setup-gocov-xml:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.0
0.9.1
2 changes: 0 additions & 2 deletions cmd/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
"github.com/stretchr/testify/suite"
)

//---- TESTS

type mainTestSuite struct {
suite.Suite
}
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# ----- Go Builder Image ------
#
FROM golang:1.17 AS builder
FROM golang:1.19 AS builder

# curl git bash
RUN apt-get update && apt-get install -y --no-install-recommends \
Expand Down
2 changes: 1 addition & 1 deletion docker/alpine-tc.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.12
FROM alpine:3.17

LABEL com.gaiaadm.pumba.skip=true

Expand Down
45 changes: 10 additions & 35 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,63 +4,38 @@ require (
github.com/docker/docker v20.10.10+incompatible
github.com/docker/go-connections v0.4.0
github.com/johntdyer/slackrus v0.0.0-20210521205746-42486fb4c48c
github.com/opencontainers/image-spec v1.0.1
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.7.0
github.com/urfave/cli v1.22.5
github.com/sirupsen/logrus v1.9.0
github.com/stretchr/testify v1.8.1
github.com/urfave/cli v1.22.10
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
)

require (
github.com/Microsoft/go-winio v0.5.1 // indirect
github.com/containerd/containerd v1.5.7 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/docker/distribution v2.7.1+incompatible // indirect
github.com/docker/go-units v0.4.0 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/protobuf v1.5.0 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/johntdyer/slack-go v0.0.0-20180213144715-95fac1160b22 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.0.1 // indirect
github.com/pelletier/go-toml v1.8.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rs/zerolog v1.18.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
github.com/spf13/afero v1.2.2 // indirect
github.com/spf13/cast v1.3.0 // indirect
github.com/spf13/cobra v1.0.0 // indirect
github.com/spf13/jwalterweatherman v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.7.0 // indirect
github.com/stretchr/objx v0.3.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
github.com/vektra/mockery/v2 v2.9.4 // indirect
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 // indirect
golang.org/x/mod v0.3.0 // indirect
github.com/stretchr/objx v0.5.0 // indirect
golang.org/x/net v0.0.0-20211111083644-e5c967477495 // indirect
golang.org/x/sys v0.0.0-20210616094352-59db8d763f22 // indirect
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
golang.org/x/text v0.3.6 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
golang.org/x/tools v0.0.0-20210106214847-113979e3529a // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/genproto v0.0.0-20201110150050-8816d57aaa9a // indirect
google.golang.org/grpc v1.42.0 // indirect
google.golang.org/grpc v1.33.2 // indirect
google.golang.org/protobuf v1.26.0 // indirect
gopkg.in/ini.v1 v1.51.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

go 1.17
go 1.19
Loading

0 comments on commit 3c9470f

Please sign in to comment.