Skip to content

Commit b3ed4d5

Browse files
authored
Remove parentheses from grep() error string (#5612)
Error strings for nearly all other functions don't have them.
1 parent c044221 commit b3ed4d5

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

runtime/sam/expr/function/grep.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type Grep struct {
1515
func (g *Grep) Call(_ super.Allocator, vals []super.Value) super.Value {
1616
patternVal, inputVal := vals[0], vals[1]
1717
if super.TypeUnder(patternVal.Type()) != super.TypeString {
18-
return g.zctx.WrapError("grep(): pattern argument must be a string", patternVal)
18+
return g.zctx.WrapError("grep: pattern argument must be a string", patternVal)
1919
}
2020
if patternVal.IsNull() {
2121
return super.NullBool

runtime/vam/expr/function/grep.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type Grep struct {
1616
func (g *Grep) Call(args ...vector.Any) vector.Any {
1717
patternVec, inputVec := args[0], args[1]
1818
if patternVec.Type().ID() != super.IDString {
19-
return vector.NewWrappedError(g.zctx, "grep(): pattern argument must be a string", patternVec)
19+
return vector.NewWrappedError(g.zctx, "grep: pattern argument must be a string", patternVec)
2020
}
2121
if inputVec.Len() == 0 {
2222
return vector.NewBoolEmpty(0, nil)

runtime/ztests/expr/function/grep.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ output: |
2424
[true,false]
2525
[true,true]
2626
[true,false]
27-
[error({message:"grep(): pattern argument must be a string",on:1}),error({message:"grep(): pattern argument must be a string",on:1})]
27+
[error({message:"grep: pattern argument must be a string",on:1}),error({message:"grep: pattern argument must be a string",on:1})]
2828
[null(bool),null(bool)]

0 commit comments

Comments
 (0)