Skip to content

Commit 79674a8

Browse files
committed
replace regexp.Compile with regexp.MustCompile
Since error is ignored, it's better to use MustCompile. Found using https://go-critic.github.io/overview#regexpMust-ref
1 parent 990c305 commit 79674a8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

definition.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ func (gl *NonNull) Error() error {
12831283
return gl.err
12841284
}
12851285

1286-
var NameRegExp, _ = regexp.Compile("^[_a-zA-Z][_a-zA-Z0-9]*$")
1286+
var NameRegExp = regexp.MustCompile("^[_a-zA-Z][_a-zA-Z0-9]*$")
12871287

12881288
func assertValidName(name string) error {
12891289
return invariantf(

0 commit comments

Comments
 (0)