chore: updated linter

This commit is contained in:
Nicholas Wiersma
2020-07-30 11:18:04 +02:00
committed by GitHub
parent 25c681c1e6
commit 9c4d3d1e5a
5 changed files with 13 additions and 10 deletions

View File

@@ -41,6 +41,7 @@
"testpackage",
"goerr113",
"nestif",
"exhaustive",
]
[issues]

View File

@@ -795,7 +795,7 @@ func (interp *Interpreter) ast(src, name string) (string, *node, error) {
}
case *ast.UnaryExpr:
var kind = unaryExpr
kind := unaryExpr
var act action
switch a.Op {
case token.ADD:

View File

@@ -35,12 +35,12 @@ func TestIsNatural(t *testing.T) {
n: &node{
typ: &itype{
rtype: func() reflect.Type {
var x = 3
x := 3
return reflect.TypeOf(x)
}(),
},
rval: func() reflect.Value {
var x = 3
x := 3
return reflect.ValueOf(x)
}(),
},

View File

@@ -53,8 +53,6 @@ type symbol struct {
rval reflect.Value // default value (used for constants)
builtin bltnGenerator // Builtin function or nil
global bool // true if symbol is defined in global space
// TODO: implement constant checking
//constant bool // true if symbol value is constant
}
// scope type stores symbols in maps, and frame layout as array of types

View File

@@ -133,7 +133,7 @@ func nodeType(interp *Interpreter, sc *scope, n *node) (*itype, error) {
return n.typ, nil
}
var t = &itype{node: n, scope: sc}
t := &itype{node: n, scope: sc}
if n.anc.kind == typeSpec {
name := n.anc.child[0].ident
@@ -690,8 +690,10 @@ func fieldName(n *node) string {
}
}
var zeroValues [maxT]reflect.Value
var okFor [aMax][maxT]bool
var (
zeroValues [maxT]reflect.Value
okFor [aMax][maxT]bool
)
func init() {
zeroValues[boolT] = reflect.ValueOf(false)
@@ -1218,8 +1220,10 @@ func exportName(s string) string {
return "X" + s
}
var interf = reflect.TypeOf((*interface{})(nil)).Elem()
var constVal = reflect.TypeOf((*constant.Value)(nil)).Elem()
var (
interf = reflect.TypeOf((*interface{})(nil)).Elem()
constVal = reflect.TypeOf((*constant.Value)(nil)).Elem()
)
// RefType returns a reflect.Type representation from an interpreter type.
// In simple cases, reflect types are directly mapped from the interpreter