Skip to content

Commit

Permalink
new linter complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
Emily Ekberg committed Jul 1, 2017
1 parent 82ebb40 commit 68f690f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions js/common/bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@ package common

import (
"context"
"errors"
"fmt"
"reflect"
"strings"

"github.com/dop251/goja"
"github.com/pkg/errors"
"github.com/serenize/snaker"
)

Expand Down Expand Up @@ -158,7 +157,7 @@ func Bind(rt *goja.Runtime, v interface{}, ctxPtr *context.Context) map[string]i
func(args []reflect.Value) []reflect.Value {
if wantsContext {
if ctxPtr == nil || *ctxPtr == nil {
Throw(rt, errors.New(fmt.Sprintf("%s needs a valid VU context", meth.Name)))
Throw(rt, errors.Errorf("%s needs a valid VU context", meth.Name))
}
args = append([]reflect.Value{reflect.ValueOf(*ctxPtr)}, args...)
} else if wantsContextPtr {
Expand Down
5 changes: 2 additions & 3 deletions js/initcontext.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,14 @@ package js

import (
"context"
"errors"
"fmt"
"strings"

"github.com/dop251/goja"
"github.com/loadimpact/k6/js/common"
"github.com/loadimpact/k6/js/compiler"
"github.com/loadimpact/k6/js/modules"
"github.com/loadimpact/k6/loader"
"github.com/pkg/errors"
"github.com/spf13/afero"
)

Expand Down Expand Up @@ -104,7 +103,7 @@ func (i *InitContext) Require(arg string) goja.Value {
func (i *InitContext) requireModule(name string) (goja.Value, error) {
mod, ok := modules.Index[name]
if !ok {
return nil, errors.New(fmt.Sprintf("unknown builtin module: %s", name))
return nil, errors.Errorf("unknown builtin module: %s", name)
}
return i.runtime.ToValue(common.Bind(i.runtime, mod, i.ctxPtr)), nil
}
Expand Down

0 comments on commit 68f690f

Please sign in to comment.