Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #65 from erikh/megacheck
Browse files Browse the repository at this point in the history
Makefile,mruby_test.go: add megacheck linter; fix checks
  • Loading branch information
Erik Hollensbe authored Sep 14, 2018
2 parents 566b37f + 3f533a4 commit 431f823
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ go:
- "1.11"
- "1.10"
install: sudo apt-get install build-essential g++ bison flex
script: make
script: make all megacheck
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ gofmt:
lint:
sh golint.sh

megacheck:
go get honnef.co/go/tools/cmd/megacheck
GO111MODULE=off megacheck ./...

libmruby.a: vendor/mruby
cd vendor/mruby && ${MAKE}
cp vendor/mruby/build/host/lib/libmruby.a .
Expand Down
10 changes: 5 additions & 5 deletions mruby_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ func TestMrbClass(t *testing.T) {
mrb := NewMrb()
defer mrb.Close()

var class *Class
class = mrb.Class("Object", nil)
class := mrb.Class("Object", nil)
if class == nil {
t.Fatal("class should not be nil")
}
Expand Down Expand Up @@ -271,7 +270,7 @@ func TestMrbGetArgs(t *testing.T) {
for i, v := range actual {
str, err := v.Call("inspect")
if err != nil {
t.Fatalf("err: %s", err)
errChan <- err
}

actualStrings[i] = str.String()
Expand Down Expand Up @@ -471,7 +470,7 @@ func TestMrbRun(t *testing.T) {
parser.Parse(`a = 10`, context)
proc = parser.GenerateCode()

stackKeep, ret, err := mrb.RunWithContext(proc, nil, 0)
stackKeep, _, err := mrb.RunWithContext(proc, nil, 0)
if err != nil {
t.Fatal(err)
}
Expand All @@ -483,7 +482,8 @@ func TestMrbRun(t *testing.T) {
parser.Parse(`a`, context)
proc = parser.GenerateCode()

stackKeep, ret, err = mrb.RunWithContext(proc, nil, stackKeep)
var ret *MrbValue
_, ret, err = mrb.RunWithContext(proc, nil, stackKeep)
if err != nil {
t.Fatal(err)
}
Expand Down

0 comments on commit 431f823

Please sign in to comment.