fix: lint issues

This commit is contained in:
Kevin Franklin Kim 2025-09-18 23:28:27 +02:00
parent 29b313ea6f
commit 9d9ae39cd4
No known key found for this signature in database
3 changed files with 10 additions and 10 deletions

View File

@ -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:

View File

@ -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
View File

@ -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