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