mirror of
https://github.com/scratchfoundation/golangci-lint.git
synced 2025-07-29 07:30:34 -04:00
dev: set timeout for loading JSON schema (#4605)
This commit is contained in:
parent
3785a3b951
commit
1ff07c1560
1 changed files with 5 additions and 1 deletions
|
@ -3,14 +3,16 @@ package commands
|
|||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
hcversion "github.com/hashicorp/go-version"
|
||||
"github.com/pelletier/go-toml/v2"
|
||||
"github.com/santhosh-tekuri/jsonschema/v5"
|
||||
_ "github.com/santhosh-tekuri/jsonschema/v5/httploader"
|
||||
"github.com/santhosh-tekuri/jsonschema/v5/httploader"
|
||||
"github.com/spf13/cobra"
|
||||
"github.com/spf13/pflag"
|
||||
"gopkg.in/yaml.v3"
|
||||
|
@ -98,6 +100,8 @@ func createSchemaURL(flags *pflag.FlagSet, buildInfo BuildInfo) (string, error)
|
|||
}
|
||||
|
||||
func validateConfiguration(schemaPath, targetFile string) error {
|
||||
httploader.Client = &http.Client{Timeout: 2 * time.Second}
|
||||
|
||||
compiler := jsonschema.NewCompiler()
|
||||
compiler.Draft = jsonschema.Draft7
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue