Skip to content

Commit

Permalink
insert fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
raoptimus committed Dec 2, 2024
1 parent a7d288d commit 847d6b5
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 6 deletions.
5 changes: 1 addition & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ linters:
- errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted.
- errname # Checks that sentinel errors are prefixed with the Err and error types are suffixed with the Error.
- errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13.
- exportloopref # checks for pointers to enclosing loop variables
- copyloopvar # checks for pointers to enclosing loop variables
- forcetypeassert # finds forced type assertions
- goconst # Finds repeated strings that could be replaced by a constant
- gocritic # Provides diagnostics that check for bugs, performance and style issues.
Expand Down Expand Up @@ -76,7 +76,6 @@ linters:
- decorder # check declaration order and count of types, constants, variables and functions
- depguard # Go linter that checks if package imports are in a list of acceptable packages
- dogsled # Checks assignments with too many blank identifiers (e.g. x, , , _, := f())
- execinquery # execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds
- exhaustive # check exhaustiveness of enum switch statements
- exhaustruct # Checks if all structure fields are initialized
- forbidigo # Forbids identifiers
Expand Down Expand Up @@ -135,8 +134,6 @@ output:

# all available settings of specific linters
linters-settings:
govet:
enable-all: true

dupl:
threshold: 100
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN export BINDIR=/go/bin \
#RUN go install github.com/boumenot/gocover-cobertura@latest \
# && go install github.com/jstemmer/go-junit-report@latest

RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.59.1
RUN wget -O- -nv https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.62.2

RUN go env -w GOFLAGS=-buildvcs=false && \
go env -w CGO_ENABLED=0
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ require (
github.com/raoptimus/db-migrator.go/pkg/iohelp v0.0.0-20240503100150-5445e535daaf
github.com/raoptimus/db-migrator.go/pkg/sqlio v0.0.0-20240503100150-5445e535daaf
github.com/raoptimus/db-migrator.go/pkg/timex v0.0.0-20240503100150-5445e535daaf
github.com/stretchr/testify v1.9.0
github.com/stretchr/testify v1.10.0
github.com/urfave/cli/v2 v2.27.5
)

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/urfave/cli/v2 v2.27.2 h1:6e0H+AkS+zDckwPCUrZkKX38mRaau4nL2uipkJpbkcI=
github.com/urfave/cli/v2 v2.27.2/go.mod h1:g0+79LmHHATl7DAcHO99smiR/T7uGLw84w8Y42x+4eM=
Expand Down
1 change: 1 addition & 0 deletions internal/dal/repository/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ func (c *Clickhouse) insertMigration(ctx context.Context, version string, isDele
c.options.TableName,
)

//nolint:gosec // overflow ok
now := uint32(time.Now().Unix())
var isDeletedInt int
if isDeleted {
Expand Down
1 change: 1 addition & 0 deletions internal/dal/repository/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ func (m *MySQL) InsertMigration(ctx context.Context, version string) error {
VALUES (?, ?)`,
m.options.TableName,
)
//nolint:gosec // overflow ok
now := uint32(time.Now().Unix())
if _, err := m.conn.ExecContext(ctx, q, version, now); err != nil {
return errors.Wrap(m.dbError(err, q), "insert migration")
Expand Down
1 change: 1 addition & 0 deletions internal/dal/repository/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ func (p *Postgres) InsertMigration(ctx context.Context, version string) error {
VALUES ($1, $2)`,
p.TableNameWithSchema(),
)
//nolint:gosec // overflow ok
now := uint32(time.Now().Unix())
if _, err := p.conn.ExecContext(ctx, q, version, now); err != nil {
return errors.Wrap(p.dbError(err, q), "insert migration")
Expand Down

0 comments on commit 847d6b5

Please sign in to comment.