Skip to content

Commit

Permalink
popm/wasm: remove unnecessary named return variables
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuasing committed Jun 27, 2024
1 parent 1d38570 commit a4f09dd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions web/popminer/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func isEmptyValue(rv reflect.Value) bool {
// | []any and [x]any | Array |
// | map[string]any | Object |
// | all others | undefined (err != nil) |
func jsValueSafe(x any) (jsv js.Value, err error) {
func jsValueSafe(x any) (js.Value, error) {
switch t := x.(type) {
case nil:
return js.Null(), nil
Expand All @@ -196,7 +196,7 @@ func jsValueSafe(x any) (jsv js.Value, err error) {
case js.Func:
return t.Value, nil
case JSMarshaler:
jsv, err = t.MarshalJS()
jsv, err := t.MarshalJS()
if err != nil {
return js.Undefined(), err
}
Expand All @@ -220,7 +220,7 @@ func jsValueSafe(x any) (jsv js.Value, err error) {
}
return o, nil
default:
err = fmt.Errorf("cannot create js.Value for %T: unsupported", x)
err := fmt.Errorf("cannot create js.Value for %T: unsupported", x)
return js.Undefined(), err
}
}
Expand Down

0 comments on commit a4f09dd

Please sign in to comment.