Skip to content

Commit 57b0d1f

Browse files
wxiaoguangdelvh
andauthored
Apply suggestions from code review
Co-authored-by: delvh <[email protected]>
1 parent 094e651 commit 57b0d1f

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

modules/templates/eval/eval_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ func TestEval(t *testing.T) {
5454
{"0 and 0", int64(0)},
5555
{"1 or 2", int64(1)},
5656
{"1 or 0", int64(1)},
57+
{"0 or 1", int64(1)},
5758
{"0 or 0", int64(0)},
5859
{"not 2 == 1", int64(1)},
5960
{"not not ( 9 < 5 )", int64(0)},

modules/util/util.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ func ToInt64(number interface{}) (int64, error) {
233233
return 0, err
234234
}
235235
default:
236-
return 0, errors.New("unable to convert to int64")
236+
return 0, fmt.Errorf("unable to convert %v to int64", number)
237237
}
238238
return value, nil
239239
}
@@ -275,7 +275,7 @@ func ToFloat64(number interface{}) (float64, error) {
275275
return 0, err
276276
}
277277
default:
278-
return 0, errors.New("unable to convert to float64")
278+
return 0, fmt.Errorf("unable to convert %v to float64", number)
279279
}
280280
return value, nil
281281
}

0 commit comments

Comments
 (0)