Questions tagged [golint]

Golint is a linter for Go source code.

Golint makes code style recommendations.

Check this Github repo for more details

NOTE: Golint is deprecated and frozen. There are some other tools for this purpose such as go vet.

38 questions
0
votes
1 answer

Golint: some issues can detect by VSCode but not command line

There are many lint issues that VSCode, which uses Golint behind can detect but the command-line version of golint cannot. Hence CI/CD tools cannot detect all issues. For example the following code: ctx, _ :=…
Trần Kim Dự
  • 5,872
  • 12
  • 55
  • 107
0
votes
2 answers

Run lint on golang repo in travis

I run locally on my project the following command gometalinter --config=gometalinter.json ./... at the beginning I got some errors and I was fixed them all! now I run the same command exaclty in Travis script and I got vendor errros like …
07_05_GuyT
  • 2,787
  • 14
  • 43
  • 88
0
votes
2 answers

replace string with patterns in file

I've used sed to replace variables on *.go files using sed -i 's/\/newName/g' *.go My objective is to eliminate golinter errors. How can strings with common patterns, e.g. replace 1 with 2 fmt.Printf("blah blah blah") or…
ironhyde
  • 936
  • 7
  • 12
0
votes
1 answer

golang compile time (static code analysis) to detect mismatch between formatting string and arguments

I recently discovered that I have a lot of logging messages that the formatting string and the arguments are not an exact match. It seems by default (I am using go 1.6) the compiler does not report such issues. Can I activate such check for go…
gsf
  • 6,612
  • 7
  • 35
  • 64
0
votes
0 answers

Golang package installation fails

I'm having a problem with package installation it worked before but suddenly I'm getting this message: package github.com/golang/lint/golint imports github.com/golang/lint imports go/types: unrecognized import path "go/types" package…
0
votes
0 answers

Golint plugin for Sublime Text 3

i'm currently learning Go, and i'm using Sublime Text 3 with the SublimeLinter plugin (which i use with other languages besides Go). I've downloaded Go using Homebrew (i'm on OS X), and i've followed the procedure explained here:…
g_rmz
  • 721
  • 2
  • 8
  • 20
-1
votes
1 answer

Why is go-lint is giving inconsistent suggestions about initialisms?

go-lint is suggesting the following: method CreateStaticCssPath should be CreateStaticCSSPath Is the linter correct and if so why? It allowed the previous method: CreateStaticJsPath
Barnaby
  • 861
  • 1
  • 14
  • 21
-3
votes
1 answer

`go list` prints out non-existing Target

As per golint's README.md: To find out where golint was installed you can run `go list -f {{.Target}} golang.org/x/lint/golint`. When I run the command I get: /Users/Marko/go/bin/golint But there is no such file: ls -alF /Users/Marko/go/bin/ total…
Marko
  • 733
  • 8
  • 21
1 2
3