Skip to content

Commit

Permalink
refactor(template): Make HTTPURLLoader private
Browse files Browse the repository at this point in the history
  • Loading branch information
pan93412 committed Aug 1, 2024
1 parent 1882319 commit 89472ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/util/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func ValidateTemplate(templateSpec []byte) error {
}

loader := jsonschema.SchemeURLLoader{
"https": &HTTPURLLoader{client: http.DefaultClient},
"https": &httpURLLoader{client: http.DefaultClient},
}

compiler := jsonschema.NewCompiler()
Expand All @@ -35,11 +35,11 @@ func ValidateTemplate(templateSpec []byte) error {
return nil
}

type HTTPURLLoader struct {
type httpURLLoader struct {
client *http.Client
}

func (l *HTTPURLLoader) Load(url string) (any, error) {
func (l *httpURLLoader) Load(url string) (any, error) {
client := l.client
resp, err := client.Get(url)
if err != nil {
Expand Down

0 comments on commit 89472ee

Please sign in to comment.