diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f5022bb..44267a4 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -17,7 +17,7 @@ jobs: - name: Install Go uses: actions/setup-go@v3 with: - go-version: 1.18 + go-version: 1.19 - name: Lint uses: golangci/golangci-lint-action@v3.2.0 diff --git a/go.mod b/go.mod index 2ea1109..b167696 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/sashamelentyev/usestdlibvars -go 1.18 +go 1.19 require golang.org/x/tools v0.1.11 diff --git a/pkg/analyzer/analyzer.go b/pkg/analyzer/analyzer.go index 03a8739..8129bb9 100644 --- a/pkg/analyzer/analyzer.go +++ b/pkg/analyzer/analyzer.go @@ -48,8 +48,8 @@ func run(pass *analysis.Pass) (interface{}, error) { insp := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) filter := []ast.Node{ - (*ast.BasicLit)(nil), (*ast.CallExpr)(nil), + (*ast.BasicLit)(nil), (*ast.CompositeLit)(nil), } @@ -203,9 +203,10 @@ func checkDefaultRPCPath(pass *analysis.Pass, pos token.Pos, currentVal string) // getBasicLitFromArgs gets the *ast.BasicLit of a function argument. // -// - count: expected number of argument in function -// - idx: index of the argument to get the *ast.BasicLit -// - typ: argument type +// Arguments: +// - count - expected number of argument in function +// - idx - index of the argument to get the *ast.BasicLit +// - typ - argument type func getBasicLitFromArgs(args []ast.Expr, count, idx int, typ token.Token) *ast.BasicLit { if len(args) != count { return nil @@ -225,7 +226,8 @@ func getBasicLitFromArgs(args []ast.Expr, count, idx int, typ token.Token) *ast. // getBasicLitFromElts gets the *ast.BasicLit of a struct elements. // -// - key: name of key in struct +// Arguments: +// - key: name of key in struct func getBasicLitFromElts(elts []ast.Expr, key string) *ast.BasicLit { for _, e := range elts { expr, ok := e.(*ast.KeyValueExpr)