Skip to content

Commit 393ab47

Browse files
committed
chore: quick cleaning
1 parent 9a1b949 commit 393ab47

File tree

5 files changed

+15
-53
lines changed

5 files changed

+15
-53
lines changed

Diff for: pkg/golinters/goanalysis/runner_loadingpackage.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,15 @@ func (lp *loadingPackage) loadFromSource(loadMode LoadMode) error {
121121

122122
pkg.IllTyped = true
123123

124-
pkg.TypesInfo = newTypesInfo()
124+
pkg.TypesInfo = &types.Info{
125+
Types: make(map[ast.Expr]types.TypeAndValue),
126+
Instances: make(map[*ast.Ident]types.Instance),
127+
Defs: make(map[*ast.Ident]types.Object),
128+
Uses: make(map[*ast.Ident]types.Object),
129+
Implicits: make(map[ast.Node]types.Object),
130+
Scopes: make(map[ast.Node]*types.Scope),
131+
Selections: make(map[*ast.SelectorExpr]*types.Selection),
132+
}
125133

126134
importer := func(path string) (*types.Package, error) {
127135
if path == unsafePkgName {

Diff for: pkg/golinters/goanalysis/runner_loadingpackage_ti.go

-21
This file was deleted.

Diff for: pkg/golinters/goanalysis/runner_loadingpackage_ti_go117.go

-20
This file was deleted.

Diff for: pkg/lint/linter/linter.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ type Noop struct {
2121
}
2222

2323
func (n Noop) Run(_ context.Context, lintCtx *Context) ([]result.Issue, error) {
24-
lintCtx.Log.Warnf("%s is disabled because of go1.18."+
25-
" You can track the evolution of the go1.18 support by following the https://github.com/golangci/golangci-lint/issues/2649.", n.name)
24+
lintCtx.Log.Warnf("%s is disabled because of generics."+
25+
" You can track the evolution of the generics support by following the https://github.com/golangci/golangci-lint/issues/2649.", n.name)
2626
return nil, nil
2727
}
2828

Diff for: test/linters_test.go

+4-9
Original file line numberDiff line numberDiff line change
@@ -312,15 +312,10 @@ func extractRunContextFromComments(t *testing.T, sourcePath string) *runContext
312312
require.Failf(t, "invalid prefix of comment line %s", line)
313313
}
314314

315-
// TODO(ldez) replace that by strings.Cut when we will drop go1.17
316-
var before string
317-
var after string
318-
if i := strings.Index(line, " "); i >= 0 {
319-
before = line[:i]
320-
after = strings.TrimSpace(line[i+len(" "):])
321-
} else {
322-
require.Failf(t, "invalid prefix of comment line %s", line)
323-
}
315+
before, after, found := strings.Cut(line, " ")
316+
require.Truef(t, found, "invalid prefix of comment line %s", line)
317+
318+
after = strings.TrimSpace(after)
324319

325320
switch before {
326321
case "//golangcitest:args":

0 commit comments

Comments
 (0)