You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer these questions before submitting your issue. Thanks!
I believe goimports does not automatically include package unsafe even if referenced in the source, which is fine, but when package unsafe is imported it can confuse goimports and produces syntactically correct, but unexpected output, such as:
import (
"reflect"
"unsafe"
)
import "fmt"
What version of Go are you using (go version)?
go version go1.6 linux/amd64
What operating system and processor architecture are you using (go env)?
package code
import (
"reflect"
"unsafe"
)
import "fmt"
var _ = fmt.Print
var _ = unsafe.Sizeof
var _ = reflect.Value
The text was updated successfully, but these errors were encountered:
ianlancetaylor
changed the title
goimports does not handle package unsafe properly
x/tools/cmd/goimports: does not handle package unsafe properly
Mar 25, 2016
Please answer these questions before submitting your issue. Thanks!
I believe goimports does not automatically include package unsafe even if referenced in the source, which is fine, but when package unsafe is imported it can confuse goimports and produces syntactically correct, but unexpected output, such as:
go version
)?go env
)?Ran goimports on the source code http://play.golang.org/p/Ppc325UINU
http://play.golang.org/p/ySR9QrdVlp
http://play.golang.org/p/i49dfImPxA
The text was updated successfully, but these errors were encountered: