Skip to content

Commit 26e8502

Browse files
authored
[TechDebt] Output of gopls modernize tool. (#404)
* [TechDebt] Output of gopls modernize tool. ChangeLog: - Upgrade to 1.24.1 * Upgrading testcontainers to latest version
1 parent 7097300 commit 26e8502

33 files changed

+158
-151
lines changed

.github/workflows/code_scanners.yml

+4-11
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ on:
77
branches:
88
- main
99

10-
env:
11-
GO_VERSION: 1.23.4
12-
13-
1410
permissions:
1511
contents: read
1612
# Optional: allow read access to pull request. Use with `only-new-issues` option.
@@ -23,19 +19,16 @@ jobs:
2319
matrix:
2420
# job_name: [security, vuln_check, lint]
2521
job_name: [security, lint]
22+
go_version: [ 1.24.1]
2623

2724
runs-on: ubuntu-latest
2825
steps:
2926
- name: Checkout Source
3027
uses: actions/checkout@v4
31-
- uses: actions/setup-go@v5
28+
- name: Setup Go
29+
uses: ./actions/setup_go
3230
with:
33-
go-version: "1.23.0"
34-
cache: false
35-
- name: Install Task
36-
run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
37-
- name: Installing Go Tools
38-
run: ./bin/task install_tools
31+
go_version: "${{ matrix.go_version }}"
3932
- name: Running Scan
4033
run: ./bin/task ${{ matrix.job_name }}
4134

.github/workflows/go.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
grafana_version: [ 10.2.8-ubuntu, 11.6.0-ubuntu ]
1414
# grafana_version: [ 10.2.8, 11.6.0]
1515
use_tokens: [ 0, 1 ]
16-
go_version: [ 1.23.4]
16+
go_version: [ 1.24.1]
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v4

.github/workflows/release-validation.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Go
1717
uses: actions/setup-go@v5
1818
with:
19-
go-version: '1.23.4'
19+
go-version: '1.24.1'
2020
- name: Log in to Docker Hub
2121
uses: docker/login-action@v3
2222
with:

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Set up Go
1919
uses: actions/setup-go@v5
2020
with:
21-
go-version: '1.23.4'
21+
go-version: '1.24.1'
2222
- name: Log in to Docker Hub
2323
uses: docker/login-action@v3
2424
with:

actions/setup_go/action.yml

+6
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,9 @@ runs:
1919
- name: Install GoTest
2020
run: go install gotest.tools/gotestsum@latest
2121
shell: bash
22+
- name: Install Task
23+
run: sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d
24+
shell: bash
25+
- name: Installing Go Tools
26+
run: ./bin/task install_tools
27+
shell: bash

cli/backup/library.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ func newLibraryElementsListConnectionsCmd() simplecobra.Commander {
158158
elements := rootCmd.GrafanaSvc().ListLibraryElementsConnections(nil, libElmentUid)
159159
slog.Info("Listing library connections for context", "context", config.Config().GetGDGConfig().GetContext())
160160
for _, link := range elements {
161-
dash := link.Dashboard.(map[string]interface{})
161+
dash := link.Dashboard.(map[string]any)
162162
rootCmd.TableObj.AppendRow(table.Row{dash["id"], dash["uid"], link.Meta.Slug, dash["title"], link.Meta.FolderTitle})
163163
}
164164
if len(elements) > 0 {

cli/support/root.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type RootCommand struct {
3535
CommandEntries []simplecobra.Commander
3636
}
3737

38-
func (cmd *RootCommand) Render(command *cobra.Command, data interface{}) {
38+
func (cmd *RootCommand) Render(command *cobra.Command, data any) {
3939
output, _ := command.Flags().GetString("output")
4040
if output == "json" {
4141
data, err := json.MarshalIndent(data, "", " ")

cli/test/tools/devel_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
func TestDevelSrvInfo(t *testing.T) {
1616
execMe := func(mock *mocks.GrafanaService, optionMockSvc func() support.RootOption) error {
17-
expected := make(map[string]interface{})
17+
expected := make(map[string]any)
1818
expected["Database"] = "db"
1919
expected["Commit"] = "commit"
2020
expected["Version"] = "version"

cli/tools/auth_service_accounts.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func newServiceAccount() simplecobra.Commander {
174174
rootCmd.TableObj.AppendHeader(table.Row{"id", "name", "role"})
175175
rootCmd.TableObj.AppendRow(table.Row{serviceAcct.ID, serviceAcct.Name, serviceAcct.Role})
176176
rootCmd.Render(cd.CobraCommand,
177-
map[string]interface{}{"id": serviceAcct.ID, "name": serviceAcct.Name, "role": serviceAcct.Role})
177+
map[string]any{"id": serviceAcct.ID, "name": serviceAcct.Name, "role": serviceAcct.Role})
178178
}
179179
return nil
180180
},

cli/tools/org_users.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func newGetUserOrgCmd() simplecobra.Commander {
5151
slog.Info("No organizations found")
5252
} else {
5353
rootCmd.TableObj.AppendRow(table.Row{org.ID, org.Name})
54-
rootCmd.Render(cd.CobraCommand, map[string]interface{}{"id": org.ID, "name": org.Name})
54+
rootCmd.Render(cd.CobraCommand, map[string]any{"id": org.ID, "name": org.Name})
5555
}
5656
return nil
5757
},

cli/tools/organizations.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func newGetTokenOrgCmd() simplecobra.Commander {
8585
slog.Info("No tokens were found")
8686
} else {
8787
rootCmd.TableObj.AppendRow(table.Row{org.ID, org.Name})
88-
rootCmd.Render(cd.CobraCommand, map[string]interface{}{"id": org.ID, "name": org.Name})
88+
rootCmd.Render(cd.CobraCommand, map[string]any{"id": org.ID, "name": org.Name})
8989
}
9090
return nil
9191
},

cli/tools/service_account_tokens.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func newServiceAccountTokenCmd() simplecobra.Commander {
107107
rootCmd.TableObj.AppendHeader(table.Row{"serviceID", "token_id", "name", "token"})
108108
rootCmd.TableObj.AppendRow(table.Row{serviceID, key.ID, key.Name, key.Key})
109109
rootCmd.Render(cd.CobraCommand,
110-
map[string]interface{}{
110+
map[string]any{
111111
"serviceID": serviceID,
112112
"token_id": key.ID,
113113
"name": key.Name,

go.mod

+30-26
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/esnet/gdg
22

3-
go 1.23.4
3+
go 1.24.1
44

55
require (
66
github.com/AlecAivazis/survey/v2 v2.3.7
@@ -12,6 +12,7 @@ require (
1212
github.com/aws/smithy-go v1.22.2
1313
github.com/bep/simplecobra v0.5.0
1414
github.com/brianvoe/gofakeit/v6 v6.28.0
15+
github.com/brianvoe/gofakeit/v7 v7.2.1
1516
github.com/carlmjohnson/requests v0.24.3
1617
github.com/go-openapi/strfmt v0.23.0
1718
github.com/google/uuid v1.6.0
@@ -22,13 +23,12 @@ require (
2223
github.com/joho/godotenv v1.5.1
2324
github.com/lmittmann/tint v1.0.7
2425
github.com/mattn/go-isatty v0.0.20
25-
github.com/opentracing/opentracing-go v1.2.0
2626
github.com/samber/lo v1.49.1
2727
github.com/sethvargo/go-password v0.3.1
2828
github.com/spf13/cobra v1.8.1
2929
github.com/spf13/viper v1.19.0
3030
github.com/stretchr/testify v1.10.0
31-
github.com/testcontainers/testcontainers-go v0.33.0
31+
github.com/testcontainers/testcontainers-go v0.36.0
3232
github.com/tidwall/gjson v1.18.0
3333
github.com/tidwall/pretty v1.2.1
3434
github.com/zeitlinger/conflate v0.0.0-20240927101413-c06be92f798f
@@ -52,7 +52,7 @@ require (
5252
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.8.0 // indirect
5353
github.com/Azure/azure-sdk-for-go/sdk/internal v1.10.0 // indirect
5454
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.4.1 // indirect
55-
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
55+
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
5656
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
5757
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
5858
github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect
@@ -98,10 +98,11 @@ require (
9898
github.com/dennwc/varint v1.0.0 // indirect
9999
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
100100
github.com/distribution/reference v0.6.0 // indirect
101-
github.com/docker/docker v27.3.1+incompatible // indirect
101+
github.com/docker/docker v28.1.1+incompatible // indirect
102102
github.com/docker/go-connections v0.5.0 // indirect
103103
github.com/docker/go-units v0.5.0 // indirect
104104
github.com/dustin/go-humanize v1.0.1 // indirect
105+
github.com/ebitengine/purego v0.8.2 // indirect
105106
github.com/edsrzf/mmap-go v1.2.0 // indirect
106107
github.com/envoyproxy/go-control-plane v0.13.1 // indirect
107108
github.com/envoyproxy/protoc-gen-validate v1.1.0 // indirect
@@ -166,10 +167,10 @@ require (
166167
github.com/jpillora/backoff v1.0.0 // indirect
167168
github.com/json-iterator/go v1.1.12 // indirect
168169
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect
169-
github.com/klauspost/compress v1.17.11 // indirect
170+
github.com/klauspost/compress v1.18.0 // indirect
170171
github.com/kylelemons/godebug v1.1.0 // indirect
171-
github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 // indirect
172-
github.com/magiconair/properties v1.8.7 // indirect
172+
github.com/lufia/plan9stats v0.0.0-20250317134145-8bc96cf8fc35 // indirect
173+
github.com/magiconair/properties v1.8.10 // indirect
173174
github.com/mailru/easyjson v0.7.7 // indirect
174175
github.com/mattn/go-colorable v0.1.13 // indirect
175176
github.com/mattn/go-runewidth v0.0.16 // indirect
@@ -183,21 +184,24 @@ require (
183184
github.com/mitchellh/mapstructure v1.5.0 // indirect
184185
github.com/mitchellh/reflectwalk v1.0.2 // indirect
185186
github.com/moby/docker-image-spec v1.3.1 // indirect
187+
github.com/moby/go-archive v0.1.0 // indirect
186188
github.com/moby/patternmatcher v0.6.0 // indirect
189+
github.com/moby/sys/atomicwriter v0.1.0 // indirect
187190
github.com/moby/sys/sequential v0.6.0 // indirect
188-
github.com/moby/sys/user v0.3.0 // indirect
191+
github.com/moby/sys/user v0.4.0 // indirect
189192
github.com/moby/sys/userns v0.1.0 // indirect
190-
github.com/moby/term v0.5.0 // indirect
193+
github.com/moby/term v0.5.2 // indirect
191194
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
192195
github.com/modern-go/reflect2 v1.0.2 // indirect
193196
github.com/morikuni/aec v1.0.0 // indirect
194197
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
195198
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
196199
github.com/oklog/ulid v1.3.1 // indirect
197200
github.com/opencontainers/go-digest v1.0.0 // indirect
198-
github.com/opencontainers/image-spec v1.1.0 // indirect
201+
github.com/opencontainers/image-spec v1.1.1 // indirect
199202
github.com/opentracing-contrib/go-grpc v0.0.0-20240724223109-9dec25a38fa8 // indirect
200203
github.com/opentracing-contrib/go-stdlib v1.0.0 // indirect
204+
github.com/opentracing/opentracing-go v1.2.0 // indirect
201205
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
202206
github.com/pires/go-proxyproto v0.8.0 // indirect
203207
github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c // indirect
@@ -216,8 +220,7 @@ require (
216220
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
217221
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
218222
github.com/sercand/kuberesolver/v5 v5.1.1 // indirect
219-
github.com/shirou/gopsutil/v3 v3.24.5 // indirect
220-
github.com/shoenig/go-m1cpu v0.1.6 // indirect
223+
github.com/shirou/gopsutil/v4 v4.25.3 // indirect
221224
github.com/shopspring/decimal v1.4.0 // indirect
222225
github.com/sirupsen/logrus v1.9.3 // indirect
223226
github.com/sony/gobreaker v1.0.0 // indirect
@@ -228,8 +231,8 @@ require (
228231
github.com/stretchr/objx v0.5.2 // indirect
229232
github.com/subosito/gotenv v1.6.0 // indirect
230233
github.com/tidwall/match v1.1.1 // indirect
231-
github.com/tklauser/go-sysconf v0.3.14 // indirect
232-
github.com/tklauser/numcpus v0.9.0 // indirect
234+
github.com/tklauser/go-sysconf v0.3.15 // indirect
235+
github.com/tklauser/numcpus v0.10.0 // indirect
233236
github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect
234237
github.com/uber/jaeger-lib v2.4.1+incompatible // indirect
235238
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
@@ -241,26 +244,27 @@ require (
241244
go.etcd.io/etcd/client/v3 v3.5.16 // indirect
242245
go.mongodb.org/mongo-driver v1.17.1 // indirect
243246
go.opencensus.io v0.24.0 // indirect
247+
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
244248
go.opentelemetry.io/collector/pdata v1.17.0 // indirect
245249
go.opentelemetry.io/contrib/detectors/gcp v1.31.0 // indirect
246250
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect
247-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect
248-
go.opentelemetry.io/otel v1.31.0 // indirect
249-
go.opentelemetry.io/otel/metric v1.31.0 // indirect
250-
go.opentelemetry.io/otel/sdk v1.31.0 // indirect
251-
go.opentelemetry.io/otel/sdk/metric v1.31.0 // indirect
252-
go.opentelemetry.io/otel/trace v1.31.0 // indirect
251+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.60.0 // indirect
252+
go.opentelemetry.io/otel v1.35.0 // indirect
253+
go.opentelemetry.io/otel/metric v1.35.0 // indirect
254+
go.opentelemetry.io/otel/sdk v1.35.0 // indirect
255+
go.opentelemetry.io/otel/sdk/metric v1.35.0 // indirect
256+
go.opentelemetry.io/otel/trace v1.35.0 // indirect
253257
go.uber.org/atomic v1.11.0 // indirect
254258
go.uber.org/multierr v1.11.0 // indirect
255259
go.uber.org/zap v1.27.0 // indirect
256260
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba // indirect
257-
golang.org/x/crypto v0.32.0 // indirect
261+
golang.org/x/crypto v0.37.0 // indirect
258262
golang.org/x/net v0.34.0 // indirect
259263
golang.org/x/oauth2 v0.23.0 // indirect
260-
golang.org/x/sync v0.11.0 // indirect
261-
golang.org/x/sys v0.30.0 // indirect
262-
golang.org/x/term v0.29.0 // indirect
263-
golang.org/x/text v0.22.0 // indirect
264+
golang.org/x/sync v0.13.0 // indirect
265+
golang.org/x/sys v0.32.0 // indirect
266+
golang.org/x/term v0.31.0 // indirect
267+
golang.org/x/text v0.24.0 // indirect
264268
golang.org/x/time v0.7.0 // indirect
265269
golang.org/x/tools v0.29.0 // indirect
266270
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect

0 commit comments

Comments
 (0)