mirror of
https://github.com/foomo/gotsrpc.git
synced 2025-10-16 12:35:35 +00:00
fix: lint issues
This commit is contained in:
parent
29b313ea6f
commit
9d9ae39cd4
@ -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:
|
||||
|
||||
@ -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 {
|
||||
|
||||
7
go.mod
7
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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user