Skip to content

Commit

Permalink
chore: quick cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
ldez committed Aug 1, 2022
1 parent 9a1b949 commit 393ab47
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 53 deletions.
10 changes: 9 additions & 1 deletion pkg/golinters/goanalysis/runner_loadingpackage.go
Expand Up @@ -121,7 +121,15 @@ func (lp *loadingPackage) loadFromSource(loadMode LoadMode) error {

pkg.IllTyped = true

pkg.TypesInfo = newTypesInfo()
pkg.TypesInfo = &types.Info{
Types: make(map[ast.Expr]types.TypeAndValue),
Instances: make(map[*ast.Ident]types.Instance),
Defs: make(map[*ast.Ident]types.Object),
Uses: make(map[*ast.Ident]types.Object),
Implicits: make(map[ast.Node]types.Object),
Scopes: make(map[ast.Node]*types.Scope),
Selections: make(map[*ast.SelectorExpr]*types.Selection),
}

importer := func(path string) (*types.Package, error) {
if path == unsafePkgName {
Expand Down
21 changes: 0 additions & 21 deletions pkg/golinters/goanalysis/runner_loadingpackage_ti.go

This file was deleted.

20 changes: 0 additions & 20 deletions pkg/golinters/goanalysis/runner_loadingpackage_ti_go117.go

This file was deleted.

4 changes: 2 additions & 2 deletions pkg/lint/linter/linter.go
Expand Up @@ -21,8 +21,8 @@ type Noop struct {
}

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

Expand Down
13 changes: 4 additions & 9 deletions test/linters_test.go
Expand Up @@ -312,15 +312,10 @@ func extractRunContextFromComments(t *testing.T, sourcePath string) *runContext
require.Failf(t, "invalid prefix of comment line %s", line)
}

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

after = strings.TrimSpace(after)

switch before {
case "//golangcitest:args":
Expand Down

0 comments on commit 393ab47

Please sign in to comment.