Skip to content

Commit

Permalink
chore: simplify checking of substrings in schema.Load
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Lehtonen <[email protected]>
  • Loading branch information
marquiz committed Jan 10, 2024
1 parent 21daeb3 commit 707429f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ func Load(source string) (*Schema, error) {
case strings.HasPrefix(source, "http://"):
case strings.HasPrefix(source, "https://"):
default:
if strings.Index(source, "://") < 0 {
if !strings.Contains(source, "://") {
source, err = filepath.Abs(source)
if err != nil {
return nil, fmt.Errorf("failed to get JSON schema absolute path for %s: %w",
Expand Down

0 comments on commit 707429f

Please sign in to comment.