Skip to content

Commit

Permalink
chore: bump Go version
Browse files Browse the repository at this point in the history
  • Loading branch information
sashamelentyev committed Aug 2, 2022
1 parent 5ab109e commit a2cf7d9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion 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

Expand Down
12 changes: 7 additions & 5 deletions pkg/analyzer/analyzer.go
Expand Up @@ -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),
}

Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit a2cf7d9

Please sign in to comment.