From 712de1c63d9db97c81af68cd0dc4372c53d2e57a Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Tue, 15 Sep 2020 18:05:35 +0200 Subject: vendor/github.com/golangci/golangci-lint: update to v1.31 --- vendor/github.com/go-toolsmith/typep/.travis.yml | 2 +- vendor/github.com/go-toolsmith/typep/README.md | 2 +- vendor/github.com/go-toolsmith/typep/predicates.go | 2 +- vendor/github.com/go-toolsmith/typep/safeExpr.go | 11 +++++++++++ 4 files changed, 14 insertions(+), 3 deletions(-) (limited to 'vendor/github.com/go-toolsmith') diff --git a/vendor/github.com/go-toolsmith/typep/.travis.yml b/vendor/github.com/go-toolsmith/typep/.travis.yml index c32ac0062..d3ff3cca8 100644 --- a/vendor/github.com/go-toolsmith/typep/.travis.yml +++ b/vendor/github.com/go-toolsmith/typep/.travis.yml @@ -5,5 +5,5 @@ install: - # Prevent default install action "go get -t -v ./...". script: - go get -t -v ./... - - go tool vet . + - go vet ./... - go test -v -race ./... diff --git a/vendor/github.com/go-toolsmith/typep/README.md b/vendor/github.com/go-toolsmith/typep/README.md index 736658012..f7979148f 100644 --- a/vendor/github.com/go-toolsmith/typep/README.md +++ b/vendor/github.com/go-toolsmith/typep/README.md @@ -1,6 +1,6 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/go-toolsmith/typep)](https://goreportcard.com/report/github.com/go-toolsmith/typep) [![GoDoc](https://godoc.org/github.com/go-toolsmith/typep?status.svg)](https://godoc.org/github.com/go-toolsmith/typep) - +[![Build Status](https://travis-ci.org/go-toolsmith/typep.svg?branch=master)](https://travis-ci.org/go-toolsmith/typep) # typep diff --git a/vendor/github.com/go-toolsmith/typep/predicates.go b/vendor/github.com/go-toolsmith/typep/predicates.go index 70e5b55cd..b07325a72 100644 --- a/vendor/github.com/go-toolsmith/typep/predicates.go +++ b/vendor/github.com/go-toolsmith/typep/predicates.go @@ -27,7 +27,7 @@ func IsTypeExpr(info *types.Info, x ast.Expr) bool { _, ok := info.ObjectOf(x).(*types.TypeName) return ok - case *ast.FuncType, *ast.StructType, *ast.InterfaceType, *ast.ArrayType, *ast.MapType: + case *ast.FuncType, *ast.StructType, *ast.InterfaceType, *ast.ArrayType, *ast.MapType, *ast.ChanType: return true default: diff --git a/vendor/github.com/go-toolsmith/typep/safeExpr.go b/vendor/github.com/go-toolsmith/typep/safeExpr.go index 7236e6e03..d5835d97b 100644 --- a/vendor/github.com/go-toolsmith/typep/safeExpr.go +++ b/vendor/github.com/go-toolsmith/typep/safeExpr.go @@ -20,6 +20,10 @@ func SideEffectFree(info *types.Info, expr ast.Expr) bool { // whitelist to be on the conservative side. // Can be extended as needed. + if expr == nil { + return true + } + switch expr := expr.(type) { case *ast.StarExpr: return SideEffectFree(info, expr.X) @@ -31,6 +35,11 @@ func SideEffectFree(info *types.Info, expr ast.Expr) bool { SideEffectFree(info, expr.X) case *ast.BasicLit, *ast.Ident: return true + case *ast.SliceExpr: + return SideEffectFree(info, expr.X) && + SideEffectFree(info, expr.Low) && + SideEffectFree(info, expr.High) && + SideEffectFree(info, expr.Max) case *ast.IndexExpr: return SideEffectFree(info, expr.X) && SideEffectFree(info, expr.Index) @@ -38,6 +47,8 @@ func SideEffectFree(info *types.Info, expr ast.Expr) bool { return SideEffectFree(info, expr.X) case *ast.ParenExpr: return SideEffectFree(info, expr.X) + case *ast.TypeAssertExpr: + return SideEffectFree(info, expr.X) case *ast.CompositeLit: return SideEffectFreeList(info, expr.Elts) case *ast.CallExpr: -- cgit mrf-deployment