unsafestrconv

package module
v0.0.0-...-e029c2f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2020 License: MIT Imports: 4 Imported by: 0

README

unsafestrconv

An analyzer to detect string(int) casts in Go programs

-CircleCI -codecov

Constructs like this are legal in Go, but probably programming errors:

x := 100
fmt.Println(string(x)) // outputs "d", not "100"

This linter helps catch those!

Note that the Go stdlib now has a better version of this check, you should use it instead! See https://github.com/golang/tools/tree/master/go/analysis/passes/stringintconv/cmd/stringintconv.

Documentation

Index

Constants

View Source
const Doc = `check for string(int) conversions`

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Doc:      Doc,
	Name:     "unsafestrconv",
	Run:      unsafestrconvCheck,
	Requires: []*analysis.Analyzer{inspect.Analyzer},
}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL