diff --git a/bootstrap/.golangci.yaml b/bootstrap/.golangci.yaml index d3c65d5..876dae8 100644 --- a/bootstrap/.golangci.yaml +++ b/bootstrap/.golangci.yaml @@ -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 - diff --git a/bootstrap/pkg/core/block.go b/bootstrap/pkg/core/block.go index e2eca06..e22fdbe 100644 --- a/bootstrap/pkg/core/block.go +++ b/bootstrap/pkg/core/block.go @@ -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...)) } diff --git a/bootstrap/pkg/core/scope.go b/bootstrap/pkg/core/scope.go index 63fd1a6..a91ef3e 100644 --- a/bootstrap/pkg/core/scope.go +++ b/bootstrap/pkg/core/scope.go @@ -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 } diff --git a/bootstrap/pkg/core/sforms.go b/bootstrap/pkg/core/sforms.go index 695df6b..fcf1702 100644 --- a/bootstrap/pkg/core/sforms.go +++ b/bootstrap/pkg/core/sforms.go @@ -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 {