Skip to content

Commit 425d849

Browse files
authored
chore: enable use-any from revive (#2948)
Signed-off-by: Matthieu MOREL <[email protected]>
1 parent 08bc960 commit 425d849

File tree

15 files changed

+47
-48
lines changed

15 files changed

+47
-48
lines changed

.golangci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ linters-settings:
7070
- name: unused-parameter
7171
disabled: true
7272
- name: use-any
73-
disabled: true
7473
- name: var-declaration
7574
- name: var-naming
7675
disabled: true

lifecycle_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ type inMemoryLogger struct {
668668
data []string
669669
}
670670

671-
func (l *inMemoryLogger) Printf(format string, args ...interface{}) {
671+
func (l *inMemoryLogger) Printf(format string, args ...any) {
672672
l.data = append(l.data, fmt.Sprintf(format, args...))
673673
}
674674

@@ -882,7 +882,7 @@ type linesTestLogger struct {
882882
data []string
883883
}
884884

885-
func (l *linesTestLogger) Printf(format string, args ...interface{}) {
885+
func (l *linesTestLogger) Printf(format string, args ...any) {
886886
l.data = append(l.data, fmt.Sprintf(format, args...))
887887
}
888888

logger.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ var (
3535

3636
// Logging defines the Logger interface
3737
type Logging interface {
38-
Printf(format string, v ...interface{})
38+
Printf(format string, v ...any)
3939
}
4040

4141
type noopLogger struct{}
4242

4343
// Printf implements Logging.
44-
func (n noopLogger) Printf(format string, v ...interface{}) {
44+
func (n noopLogger) Printf(format string, v ...any) {
4545
// NOOP
4646
}
4747

@@ -98,7 +98,7 @@ type testLogger struct {
9898
}
9999

100100
// Printf implements Logging.
101-
func (t testLogger) Printf(format string, v ...interface{}) {
101+
func (t testLogger) Printf(format string, v ...any) {
102102
t.Helper()
103103
t.Logf(format, v...)
104104
}

modulegen/internal/mkdocs/types.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ type Config struct {
2424
Logo string `yaml:"logo"`
2525
Favicon string `yaml:"favicon"`
2626
} `yaml:"theme"`
27-
ExtraCSS []string `yaml:"extra_css"`
28-
RepoName string `yaml:"repo_name"`
29-
RepoURL string `yaml:"repo_url"`
30-
MarkdownExtensions []interface{} `yaml:"markdown_extensions"`
27+
ExtraCSS []string `yaml:"extra_css"`
28+
RepoName string `yaml:"repo_name"`
29+
RepoURL string `yaml:"repo_url"`
30+
MarkdownExtensions []any `yaml:"markdown_extensions"`
3131
Nav []struct {
32-
Home string `yaml:"Home,omitempty"`
33-
Quickstart string `yaml:"Quickstart,omitempty"`
34-
Features []interface{} `yaml:"Features,omitempty"`
35-
Examples []string `yaml:"Examples,omitempty"`
36-
Modules []string `yaml:"Modules,omitempty"`
37-
SystemRequirements []interface{} `yaml:"System Requirements,omitempty"`
38-
Contributing string `yaml:"Contributing,omitempty"`
39-
GettingHelp string `yaml:"Getting help,omitempty"`
32+
Home string `yaml:"Home,omitempty"`
33+
Quickstart string `yaml:"Quickstart,omitempty"`
34+
Features []any `yaml:"Features,omitempty"`
35+
Examples []string `yaml:"Examples,omitempty"`
36+
Modules []string `yaml:"Modules,omitempty"`
37+
SystemRequirements []any `yaml:"System Requirements,omitempty"`
38+
Contributing string `yaml:"Contributing,omitempty"`
39+
GettingHelp string `yaml:"Getting help,omitempty"`
4040
} `yaml:"nav"`
4141
EditURI string `yaml:"edit_uri"`
4242
Extra struct {

modules/chroma/examples_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ func ExampleChromaContainer_collections() {
131131
col1, err := col.Add(
132132
context.Background(),
133133
nil, // embeddings
134-
[]map[string]interface{}{}, // metadata
134+
[]map[string]any{}, // metadata
135135
[]string{"test-doc-1", "test-doc-2"}, // documents
136136
[]string{"test-label-1", "test-label-2"}, // ids
137137
)

modules/compose/compose_builder_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func writeTemplateWithSrvType(t *testing.T, templateFile string, srvType string,
146146
tmpl, err := template.ParseFiles(filepath.Join(testdataPackage, templateFile))
147147
require.NoErrorf(t, err, "parsing template file")
148148

149-
values := map[string]interface{}{}
149+
values := map[string]any{}
150150
for i, p := range port {
151151
values[fmt.Sprintf("Port_%d", i)] = p
152152
}

modules/compose/compose_local.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ type LocalDockerCompose struct {
5454
Identifier string
5555
Cmd []string
5656
Env map[string]string
57-
Services map[string]interface{}
57+
Services map[string]any
5858
waitStrategySupplied bool
5959
WaitStrategyMap map[waitService]wait.Strategy
6060
}
@@ -254,7 +254,7 @@ func (dc *LocalDockerCompose) determineVersion() error {
254254
// references to all services in them
255255
func (dc *LocalDockerCompose) validate() error {
256256
type compose struct {
257-
Services map[string]interface{}
257+
Services map[string]any
258258
}
259259

260260
for _, abs := range dc.absComposeFilePaths {

modules/gcloud/spanner_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func ExampleRunSpannerContainer() {
117117
_, err = client.Apply(ctx, []*spanner.Mutation{
118118
spanner.Insert("Languages",
119119
[]string{"language", "mascot"},
120-
[]interface{}{"Go", "Gopher"}),
120+
[]any{"Go", "Gopher"}),
121121
})
122122
if err != nil {
123123
log.Printf("failed to apply mutation: %v", err)

modules/grafana-lgtm/grafana_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func TestGrafanaLGTM(t *testing.T) {
4141

4242
require.Equal(t, http.StatusOK, httpResp.StatusCode)
4343

44-
body := make(map[string]interface{})
44+
body := make(map[string]any)
4545
err = json.NewDecoder(httpResp.Body).Decode(&body)
4646
require.NoError(t, err)
4747
require.Equal(t, "11.0.0", body["version"])

modules/mockserver/examples_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func ExampleRun_connect() {
6969
Method: http.MethodPost,
7070
Path: "/api/categories",
7171
}
72-
requestMatcher = requestMatcher.WithJSONFields(map[string]interface{}{"name": "Tools"})
72+
requestMatcher = requestMatcher.WithJSONFields(map[string]any{"name": "Tools"})
7373
err = ms.RegisterExpectation(client.NewExpectation(requestMatcher).WithResponse(client.NewResponseOK().WithJSONBody(map[string]any{"test": "value"})))
7474
if err != nil {
7575
log.Printf("failed to register expectation: %s", err)

0 commit comments

Comments
 (0)