
* Initial commit * Fixed goimports * Update pkg/golinters/mnd.go Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com> * Run goimports * Update pkg/golinters/mnd.go Co-Authored-By: Bot from GolangCI <42910462+golangcibot@users.noreply.github.com> * Add prefix for goimport local * Run make README.md * Incorporate review comments Add test cases * Update readme * Update the description * Removed subpath in local-prefixes * Update readme
13 lines
224 B
Go
13 lines
224 B
Go
package checks
|
|
|
|
import (
|
|
"go/ast"
|
|
"go/token"
|
|
)
|
|
|
|
const reportMsg = "Magic number: %v, in <%s> detected"
|
|
|
|
func isMagicNumber(l *ast.BasicLit) bool {
|
|
return (l.Kind == token.FLOAT || l.Kind == token.INT) && l.Value != "0"
|
|
}
|