diff --git a/acl/types.go b/acl/types.go index c9bbfd3c..c80c9cdb 100644 --- a/acl/types.go +++ b/acl/types.go @@ -2,8 +2,12 @@ package acl const ( _ MatchType = iota - stringEqual - stringNotEqual + + // StringEqual is a MatchType of string equality. + StringEqual + + // StringNotEqual is a MatchType of string inequality. + StringNotEqual ) const ( diff --git a/acl/wrappers.go b/acl/wrappers.go index 94e420aa..30c2ee3f 100644 --- a/acl/wrappers.go +++ b/acl/wrappers.go @@ -83,9 +83,9 @@ func (s EACLFilterWrapper) MatchType() (res MatchType) { if s.filter != nil { switch s.filter.GetMatchType() { case EACLRecord_FilterInfo_StringEqual: - res = stringEqual + res = StringEqual case EACLRecord_FilterInfo_StringNotEqual: - res = stringNotEqual + res = StringNotEqual } } @@ -102,9 +102,9 @@ func (s EACLFilterWrapper) MatchType() (res MatchType) { func (s EACLFilterWrapper) SetMatchType(v MatchType) { if s.filter != nil { switch v { - case stringEqual: + case StringEqual: s.filter.SetMatchType(EACLRecord_FilterInfo_StringEqual) - case stringNotEqual: + case StringNotEqual: s.filter.SetMatchType(EACLRecord_FilterInfo_StringNotEqual) default: s.filter.SetMatchType(EACLRecord_FilterInfo_MatchUnknown) diff --git a/acl/wrappers_test.go b/acl/wrappers_test.go index a55db8ca..b7dbbe05 100644 --- a/acl/wrappers_test.go +++ b/acl/wrappers_test.go @@ -9,7 +9,7 @@ import ( func TestEACLFilterWrapper(t *testing.T) { s := WrapFilterInfo(nil) - mt := stringEqual + mt := StringEqual s.SetMatchType(mt) require.Equal(t, mt, s.MatchType())