Skip to content

Commit

Permalink
Use regexp.MatchString instead of an allocating conversion
Browse files Browse the repository at this point in the history
Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
  • Loading branch information
mtrmac committed Nov 25, 2024
1 parent 17f0ec3 commit 37d24bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oci/internal/oci_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func ValidateScope(scope string) error {
}

func validateScopeWindows(scope string) error {
matched, _ := regexp.Match(`^[a-zA-Z]:\\`, []byte(scope))
matched, _ := regexp.MatchString(`^[a-zA-Z]:\\`, scope)
if !matched {
return fmt.Errorf("Invalid scope '%s'. Must be an absolute path", scope)
}
Expand Down

0 comments on commit 37d24bf

Please sign in to comment.