Closed
Description
Describe the bug
When using CGO an import "C"
is required to active cgo (and import/define C code). The blank-imports check does not accept this and throws the following warning:
blank-imports: a blank import should be only in a main or test package, or have a comment justifying it (revive)
To Reproduce
Consider this main.go file:
package main
import "unsafe"
// #include <stdlib.h>
import "C"
func main() {
cStr := C.CString("test")
C.free(unsafe.Pointer(cStr))
}
Run revive
for this file and the waring appears for the import "C"
line.
Expected behavior
There should not be a warning for this file.
Desktop (please complete the following information):
- OS: Arch Linux
- go version go1.17.7 linux/amd64
Metadata
Metadata
Assignees
Labels
No labels