While legal, such declarations will make using the package exported identifiers impossible after the declaration or create confusion when reading the code.
Example:
import "fmt"
import _ "fmt"
import iio "io"
func _() {
fmt.Println("demo")
demo := true
_, _ = iio.EOF, demo
}
func demo() (int, int) {
return 1, 2
}
func _() {
_, _ = iio.EOF, demo
fmt := "demo"
iio := 1
_, _ = iio, fmt
a, _ := demo()
_ = a
}
Variable names fmt and iio clash with names of import packages. Not to confuse them later in code, it is better
to rename these variables.