Skip to content

Commit 707429f

Browse files
committed
chore: simplify checking of substrings in schema.Load
Signed-off-by: Markus Lehtonen <[email protected]>
1 parent 21daeb3 commit 707429f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

schema/schema.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ func Load(source string) (*Schema, error) {
135135
case strings.HasPrefix(source, "http://"):
136136
case strings.HasPrefix(source, "https://"):
137137
default:
138-
if strings.Index(source, "://") < 0 {
138+
if !strings.Contains(source, "://") {
139139
source, err = filepath.Abs(source)
140140
if err != nil {
141141
return nil, fmt.Errorf("failed to get JSON schema absolute path for %s: %w",

0 commit comments

Comments
 (0)