Skip to content

Commit

Permalink
feat(language): fix linter for go
Browse files Browse the repository at this point in the history
  • Loading branch information
Talent Zeng committed Sep 19, 2024
1 parent 7a2fba7 commit 78797b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/go/validation/validation-rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func ValidateObject(object string) bool {
return typeMatch && objectMatch
}

func ValidateObjectId(relation string) bool {
func ValidateObjectID(relation string) bool {
match, _ := regexp.MatchString(fmt.Sprintf("^%s$", RuleID), relation)

return match
Expand Down
5 changes: 3 additions & 2 deletions pkg/go/validation/validation-rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func validateBadStructure(t *testing.T, validator func(string) bool) {
assert.False(t, validator("item:**"))
}

func TestValidateObjectId(t *testing.T) {
func TestValidateObjectID(t *testing.T) {
t.Parallel()

tests := []struct {
Expand Down Expand Up @@ -54,7 +54,8 @@ func TestValidateObjectId(t *testing.T) {

for _, test := range tests {
t.Run(test.value, func(t *testing.T) {
assert.Equal(t, test.expected, ValidateObjectId(test.value))
t.Parallel()
assert.Equal(t, test.expected, ValidateObjectID(test.value))
})
}

Expand Down

0 comments on commit 78797b8

Please sign in to comment.