golint Questions
2
I try go1.16
import "embed"
I get
> golangci-lint run ./...
> Can't run linter goanalysis_metalinter: bodyclose: failed prerequisites ... could not import embed
how skip file/pack...
4
Solved
I'm getting the following golintci message:
testdrive/utils.go:92:16: G110: Potential DoS vulnerability via decompression bomb (gosec)
if _, err := io.Copy(targetFile, fileReader); err != nil {
^...
Judgeship asked 30/4, 2021 at 2:9
4
Solved
I tried this code in Go:
type Agent struct {
name string // Not exported
categoryId int // Not exported
}
And VS Code reports the following problem:
exported type Agent should have comment ...
Elis asked 26/10, 2018 at 8:12
14
I have installed the Go extension (version 0.11.4) in Visual Studio Code on MacOS:
However, I find that the linter does not 'pick up' functions defined in the same package, but in different file...
Spracklen asked 19/9, 2019 at 20:45
2
I get this error message:
main.go:24: File is not `gci`-ed with --skip-generated -s standard,default (gci)
import (
What does this mean?
Background: I am new to Go, and the linting was not set up ...
1
I upgraded the version of go to go1.18.3, following the instruction on https://go.dev/doc/install:
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.3.linux-amd64.tar.gz
export PATH=$PA...
Ardatharde asked 17/6, 2022 at 8:9
4
Solved
I am passing an uuid in using the Context and WithValue to subsequent functions that handle this *http.request. This uuid is was passed in the authorization header to a REST call to identify a pers...
1
Solved
I'm getting the following output when running https://golangci-lint.run/:
rangeValCopy: each iteration copies 128 bytes (consider pointers or indexing) (gocritic)
for _, v := range products {
Her...
1
© 2022 - 2024 — McMap. All rights reserved.