Skip to content

Commit

Permalink
remove uneeded loadFromURI
Browse files Browse the repository at this point in the history
  • Loading branch information
Reuven committed Dec 17, 2023
1 parent abfde44 commit 53ec8b6
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions load/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,12 @@ func From(loader Loader, source *Source) (*openapi3.T, error) {
case SourceTypeStdin:
return loader.LoadFromStdin()
case SourceTypeURL:
return loadFromURI(loader, source.Uri)
return loader.LoadFromURI(source.Uri)
default:
return loader.LoadFromFile(source.Path)
}
}

func loadFromURI(loader Loader, uri *url.URL) (*openapi3.T, error) {
oas, err := loader.LoadFromURI(uri)
if err != nil {
return nil, err
}
return oas, nil
}

func getURL(rawURL string) (*url.URL, error) {
url, err := url.ParseRequestURI(rawURL)
if err != nil {
Expand Down

0 comments on commit 53ec8b6

Please sign in to comment.