diff --git a/.golangci.yaml b/.golangci.yaml index 1f78dd9..9182c21 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -1,10 +1,10 @@ -# yaml-language-server: $schema=https://golangci-lint.run/jsonschema/golangci.jsonschema.json # https://golangci-lint.run/usage/configuration/ version: "2" + run: - go: 1.24.0 - build-tags: [safe] + build-tags: [ safe ] modules-download-mode: readonly + linters: default: none enable: diff --git a/cmd/gotsrpc/gotsrpc.go b/cmd/gotsrpc/gotsrpc.go index 7f7686f..175e8e2 100644 --- a/cmd/gotsrpc/gotsrpc.go +++ b/cmd/gotsrpc/gotsrpc.go @@ -2,6 +2,7 @@ package main import ( "bytes" + "context" "flag" "fmt" "os" @@ -42,6 +43,8 @@ func main() { flag.Usage = usage flag.Parse() + ctx := context.Background() + args := flag.Args() switch { case len(args) == 0: @@ -67,13 +70,13 @@ func main() { var goRoot string var goPath string - if out, err := exec.Command("go", "env", "GOROOT").Output(); err != nil { + if out, err := exec.CommandContext(ctx, "go", "env", "GOROOT").Output(); err != nil { fmt.Println("failed to retrieve GOROOT", err.Error()) os.Exit(1) } else { goRoot = string(bytes.TrimSpace(out)) } - if out, err := exec.Command("go", "env", "GOPATH").Output(); err != nil { + if out, err := exec.CommandContext(ctx, "go", "env", "GOPATH").Output(); err != nil { fmt.Println("failed to retrieve GOPATH", err.Error()) os.Exit(1) } else { diff --git a/go.mod b/go.mod index fb4b776..e449216 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,9 @@ go 1.24.0 require ( github.com/davecgh/go-spew v1.1.1 // indirect + github.com/foomo/go v0.0.3 github.com/iancoleman/strcase v0.2.0 // Be aware of https://github.com/iancoleman/strcase/pull/49 + github.com/invopop/jsonschema v0.13.0 github.com/mitchellh/mapstructure v1.5.0 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.23.2 @@ -15,11 +17,6 @@ require ( gopkg.in/yaml.v2 v2.4.0 ) -require ( - github.com/foomo/go v0.0.3 - github.com/invopop/jsonschema v0.13.0 -) - require ( github.com/bahlo/generic-list-go v0.2.0 // indirect github.com/beorn7/perks v1.0.1 // indirect