We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bb4c4c commit 3fb2152Copy full SHA for 3fb2152
stylecheck/st1019/st1019.go
@@ -67,6 +67,11 @@ func run(pass *analysis.Pass) (any, error) {
67
}
68
69
for path, value := range imports {
70
+ if path[1:len(path)-1] == "unsafe" {
71
+ // Don't flag unsafe. Cgo generated code imports
72
+ // unsafe as _cgo_unsafe, in addition to the user's import.
73
+ continue
74
+ }
75
// If there's more than one import per path, we flag that
76
if len(value) > 1 {
77
s := fmt.Sprintf("package %s is being imported more than once", path)
0 commit comments