diff --git a/shared/serializableRegexp.go b/shared/serializableRegexp.go index a0a513ff6..e311fdeb5 100644 --- a/shared/serializableRegexp.go +++ b/shared/serializableRegexp.go @@ -6,8 +6,6 @@ type SerializableRegexp struct { regexp.Regexp } -// CompileRegexToSerializableRegexp wraps the result of the standard library's -// regexp.Compile, for easy (un)marshaling. func CompileRegexToSerializableRegexp(expr string) (*SerializableRegexp, error) { re, err := regexp.Compile(expr) if err != nil { @@ -16,8 +14,7 @@ func CompileRegexToSerializableRegexp(expr string) (*SerializableRegexp, error) return &SerializableRegexp{*re}, nil } -// UnmarshalText satisfies the encoding.TextMarshaler interface, -// also used by json.Unmarshal. +// UnmarshalText is by json.Unmarshal. func (r *SerializableRegexp) UnmarshalText(text []byte) error { rr, err := CompileRegexToSerializableRegexp(string(text)) if err != nil { @@ -27,8 +24,7 @@ func (r *SerializableRegexp) UnmarshalText(text []byte) error { return nil } -// MarshalText satisfies the encoding.TextMarshaler interface, -// also used by json.Marshal. +// MarshalText is used by json.Marshal. func (r *SerializableRegexp) MarshalText() ([]byte, error) { return []byte(r.String()), nil }