Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/qawatake/intcast
Analyzer: intcast finds integer type cast that can cause overflow
https://github.com/qawatake/intcast
go golang linter staticanalysis
Last synced: about 1 month ago
JSON representation
Analyzer: intcast finds integer type cast that can cause overflow
- Host: GitHub
- URL: https://github.com/qawatake/intcast
- Owner: qawatake
- License: mit
- Created: 2023-08-01T10:04:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-20T14:21:03.000Z (about 1 year ago)
- Last Synced: 2024-10-07T05:21:06.063Z (3 months ago)
- Topics: go, golang, linter, staticanalysis
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# intcast
`intcast` identifies integer type casts that can potentially cause overflow.
```go
func f(i int) uint {
return uint(i) // unsafe cast
}
````intcast` also handles casts on defined types.
```go
type MyInt int
func f(i MyInt) uint {
return uint(i) // unsafe cast
}
````intcast` ignores lines with ignore comments.
```go
func f(i int) uint {
//lint:ignore intcast reason
return uint(i)
}
```## How to use
```sh
go install github.com/qawatake/intcast/cmd/intcast@latest
intcast ./...
```