Skip to content

Commit

Permalink
js/modules: reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoykov committed Jul 15, 2024
1 parent 245e6c3 commit 4519ed2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion js/modules/cjsmodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ func (cmi *cjsModuleInstance) ExecuteModule(rt *sobek.Runtime, _, _ func(any)) (
_ = module.Set("exports", cmi.exports)
call, ok := sobek.AssertFunction(v)
if !ok {
panic("Somehow a CommonJS module is not wrapped in a function - this is a k6 bug, please report it (https://github.com/grafana/k6/issues)")
panic("Somehow a CommonJS module is not wrapped in a function - " +
"this is a k6 bug, please report it (https://github.com/grafana/k6/issues)")
}
if _, err = call(cmi.exports, module, cmi.exports); err != nil {
return nil, err
Expand Down
6 changes: 4 additions & 2 deletions js/modules/require_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ func (ms *ModuleSystem) getModuleInstanceFromGoModule(wm *goModule) (wmi *goModu
}
gmi, ok := mi.(*goModuleInstance)
if !ok {
panic(fmt.Sprintf("a goModule instance is of not goModuleInstance type (got %T). This is a k6 bug please report it (https://github.com/grafana/k6/issues)", mi))
panic(fmt.Sprintf("a goModule instance is of not goModuleInstance type (got %T). "+
"This is a k6 bug please report it (https://github.com/grafana/k6/issues)", mi))
}
return gmi, nil
}
Expand Down Expand Up @@ -112,7 +113,8 @@ func (ms *ModuleSystem) CurrentlyRequiredModule() (*url.URL, error) {
return nil, err
}
default:
return nil, fmt.Errorf("couldn't parse %q as module url - this is a k6 bug, please report it (https://github.com/grafana/k6/issues)", fileStr)
return nil, fmt.Errorf("couldn't parse %q as module url - this is a k6 bug, "+
"please report it (https://github.com/grafana/k6/issues)", fileStr)
}
return loader.Dir(u), nil
}
Expand Down

0 comments on commit 4519ed2

Please sign in to comment.