Skip to content

Commit f6d86df

Browse files
authored
Merge pull request #148 from scribd/maksimt/DEVPLAT-5297/go-1.25
[DEVPLAT-5297] Upgrade go version to v1.25.0
2 parents ac5bf6d + 11ea8ee commit f6d86df

File tree

17 files changed

+63
-79
lines changed

17 files changed

+63
-79
lines changed

.golangci.yml

Lines changed: 39 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,49 @@
1+
version: "2"
12
run:
2-
# timeout for analysis, e.g. 30s, 5m, default is 1m
3-
timeout: 2m
4-
5-
# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
6-
# If invoked with -mod=readonly, the go command is disallowed from the implicit
7-
# automatic updating of go.mod described above. Instead, it fails when any changes
8-
# to go.mod are needed. This setting is most useful to check that go.mod does
9-
# not need updates, such as in a continuous integration and testing system.
10-
# If invoked with -mod=vendor, the go command assumes that the vendor
11-
# directory holds the correct copies of dependencies and ignores
12-
# the dependency descriptions in go.mod.
133
modules-download-mode: readonly
14-
154
linters:
165
enable:
176
- bodyclose
18-
- errcheck
197
- goconst
20-
- gofmt
21-
- gosimple
22-
- govet
23-
- ineffassign
248
- lll
259
- misspell
26-
- staticcheck
27-
- typecheck
2810
- unconvert
2911
- unparam
30-
- unused
31-
32-
linters-settings:
33-
errcheck:
34-
# report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`;
35-
# default is false: such cases aren't reported by default.
36-
check-blank: true
37-
govet:
38-
enable:
39-
- shadow
40-
lll:
41-
line-length: 120
42-
misspell:
43-
locale: US
44-
unused:
45-
check-exported: false
46-
unparam:
47-
check-exported: false
48-
49-
issues:
50-
# Which dirs to exclude: issues from them won't be reported.
51-
# Can use regexp here: `generated.*`, regexp is applied on full path,
52-
# including the path prefix if one is set.
53-
# Default dirs are skipped independently of this option's value (see exclude-dirs-use-default).
54-
# "/" will be replaced by current OS file path separator to properly work on Windows.
55-
# Default: []
56-
exclude-dirs:
57-
- configs
58-
exclude-rules:
59-
# SA1029 – Inappropriate key in call to context.WithValue
60-
# https://staticcheck.io/docs/checks#SA1029
61-
- linters:
62-
- staticcheck
63-
text: "SA1029:"
12+
settings:
13+
errcheck:
14+
check-blank: true
15+
govet:
16+
enable:
17+
- shadow
18+
lll:
19+
line-length: 120
20+
misspell:
21+
locale: US
22+
unparam:
23+
check-exported: false
24+
exclusions:
25+
generated: lax
26+
presets:
27+
- comments
28+
- common-false-positives
29+
- legacy
30+
- std-error-handling
31+
rules:
32+
- linters:
33+
- staticcheck
34+
text: 'SA1029:'
35+
paths:
36+
- configs
37+
- third_party$
38+
- builtin$
39+
- examples$
40+
formatters:
41+
enable:
42+
- gofmt
43+
exclusions:
44+
generated: lax
45+
paths:
46+
- configs
47+
- third_party$
48+
- builtin$
49+
- examples$

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# build stage
33
# =============================================================================
44

5-
FROM golang:1.24.2-alpine AS builder
5+
FROM golang:1.25.0-alpine AS builder
66

77
WORKDIR /sdk
88

@@ -33,15 +33,15 @@ FROM builder AS linter
3333

3434
# binary will be $(go env GOPATH)/bin/golangci-lint
3535
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh \
36-
| sh -s -- -b $(go env GOPATH)/bin v1.64.8
36+
| sh -s -- -b $(go env GOPATH)/bin v2.4.0
3737

3838
# install goimports
39-
RUN go install golang.org/x/tools/cmd/goimports@v0.32.0
39+
RUN go install golang.org/x/tools/cmd/goimports@v0.36.0
4040

4141
# =============================================================================
4242
# development stage
4343
# =============================================================================
4444

4545
FROM linter AS development
4646

47-
RUN go install github.com/go-delve/delve/cmd/dlv@v1.24.2
47+
RUN go install github.com/go-delve/delve/cmd/dlv@v1.25.1

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ SDK, the Go version.
6767

6868
## Prerequisites
6969

70-
* [Go](https://golang.org) (version `1.24.0`).
70+
* [Go](https://golang.org) (version `1.25.0`).
7171
* [Docker](https://www.docker.com/) (version `19.03.2`).
7272

7373
## SDK functionality
@@ -1736,7 +1736,7 @@ You can enter the docker environment to build, run and debug your service:
17361736
```
17371737
$ docker-compose run --rm sdk /bin/bash
17381738
root@1f31fa8e5c49:/sdk# go version
1739-
go version go1.24.0 linux/amd64
1739+
go version go1.25.0 linux/amd64
17401740
```
17411741

17421742
Refer to the

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module github.com/scribd/go-sdk
22

3-
go 1.24.0
4-
5-
toolchain go1.24.2
3+
go 1.25.0
64

75
require (
86
github.com/DATA-DOG/go-sqlmock v1.5.2

internal/pkg/configuration/builder/viper.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func (vb *ViperBuilder) Build() (*viper.Viper, error) {
6565
env := vb.vConf.GetString("ENV")
6666
vb.vConf = vb.vConf.Sub(env)
6767
if vb.vConf == nil {
68-
return nil, fmt.Errorf("No %s configuration for ENV %s", vb.name, env)
68+
return nil, fmt.Errorf("no %s configuration for ENV %s", vb.name, env)
6969
}
7070

7171
vb.vConf.Set("ENV", env)
@@ -76,7 +76,7 @@ func (vb *ViperBuilder) Build() (*viper.Viper, error) {
7676
allKeys := vb.vConf.AllKeys()
7777
for _, k := range allKeys {
7878
if err := vb.vConf.BindEnv(strings.ToUpper(k)); err != nil {
79-
return nil, fmt.Errorf("Could not configure %s for ENV %s", k, env)
79+
return nil, fmt.Errorf("could not configure %s for ENV %s", k, env)
8080
}
8181

8282
}

pkg/context/database/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var (
2222
func Extract(ctx context.Context) (*gorm.DB, error) {
2323
d, ok := ctx.Value(ctxDatabaseKey).(*ctxDatabase)
2424
if !ok || d == nil {
25-
return nil, fmt.Errorf("Unable to get the database")
25+
return nil, fmt.Errorf("unable to get the database")
2626
}
2727

2828
return d.database, nil

pkg/context/logger/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func AddFields(ctx context.Context, fields sdklogger.Fields) {
3636
func Extract(ctx context.Context) (sdklogger.Logger, error) {
3737
l, ok := ctx.Value(ctxLoggerKey).(*ctxLogger)
3838
if !ok || l == nil {
39-
return nil, fmt.Errorf("Unable to get the logger")
39+
return nil, fmt.Errorf("unable to get the logger")
4040
}
4141

4242
fields := sdklogger.Fields{}

pkg/context/metrics/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var (
2222
func Extract(ctx context.Context) (sdkmetrics.Metrics, error) {
2323
m, ok := ctx.Value(ctxMetricsKey).(*ctxMetrics)
2424
if !ok || m == nil {
25-
return nil, fmt.Errorf("Unable to get the metrics")
25+
return nil, fmt.Errorf("unable to get the metrics")
2626
}
2727

2828
return m.metrics, nil

pkg/context/requestid/context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var (
2020
func Extract(ctx context.Context) (string, error) {
2121
r, ok := ctx.Value(ctxRequestIDKey).(*ctxRequestID)
2222
if !ok || r == nil {
23-
return "", fmt.Errorf("Unable to get the requestID")
23+
return "", fmt.Errorf("unable to get the requestID")
2424
}
2525

2626
return r.requestID, nil

pkg/context/requestid/context_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func TestExtract(t *testing.T) {
2020
ctxSet: func(ctx context.Context) context.Context {
2121
return ctx
2222
},
23-
expectedError: fmt.Errorf("Unable to get the requestID"),
23+
expectedError: fmt.Errorf("unable to get the requestID"),
2424
},
2525
{
2626
name: "Context contains request id",

0 commit comments

Comments
 (0)