chore: updated linter
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
"testpackage",
|
||||
"goerr113",
|
||||
"nestif",
|
||||
"exhaustive",
|
||||
]
|
||||
|
||||
[issues]
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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)
|
||||
}(),
|
||||
},
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user