Fix some random linting issues
This commit is contained in:
parent
8bcf1ea566
commit
fabb3cbb32
|
@ -34,7 +34,7 @@ linters-settings:
|
|||
gomnd:
|
||||
settings:
|
||||
mnd:
|
||||
checks: argument,case,condition,return
|
||||
checks: argument,return
|
||||
govet:
|
||||
check-shadowing: true
|
||||
maligned:
|
||||
|
@ -100,4 +100,3 @@ run:
|
|||
tests: true
|
||||
skip-dirs-use-default: true
|
||||
allow-parallel-runners: true
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ func (b *Block) GetLocation() *ast.Location {
|
|||
return ast.MakeUnknownLocation()
|
||||
}
|
||||
|
||||
func (l *Block) Hash() uint32 {
|
||||
func (b *Block) Hash() uint32 {
|
||||
bytes := []byte("TODO")
|
||||
return hash.Of(append([]byte{byte(ast.Block)}, bytes...))
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ func (s *Scope) GetNS(rt *Runtime) *Namespace {
|
|||
}
|
||||
ns, ok := rt.GetNS(*s.ns)
|
||||
if !ok {
|
||||
panic(fmt.Sprintf("A scope with the wrong namespace! '%s'", s.ns))
|
||||
panic(fmt.Sprintf("A scope with the wrong namespace! '%s'", *(s.ns)))
|
||||
}
|
||||
return ns
|
||||
}
|
||||
|
|
|
@ -29,8 +29,7 @@ import (
|
|||
// the second param should be the value of the binding
|
||||
func Def(rt *Runtime, scope IScope, args *List) (IExpr, IError) {
|
||||
// TODO: Add support for docstrings and meta
|
||||
switch args.Count() {
|
||||
case 2:
|
||||
if args.Count() == 2 {
|
||||
name := args.First()
|
||||
|
||||
if name.GetType() != ast.Symbol {
|
||||
|
@ -104,7 +103,7 @@ func DefMacro(rt *Runtime, scope IScope, args *List) (IExpr, IError) {
|
|||
}
|
||||
|
||||
// Fn defines a function inside the given scope `scope` with the given `args`.
|
||||
// `args` contains the arugment list, docstring and body of the function.
|
||||
// `args` contains the argument list, docstring and body of the function.
|
||||
func Fn(rt *Runtime, scope IScope, args *List) (IExpr, IError) {
|
||||
|
||||
if args.Count() < 2 {
|
||||
|
|
Loading…
Reference in New Issue