You will have to prefix a function if it is not in the current package.
What you can do however is create an alias for this package:
import f "fmt"
func main() {
f.Println("Hello World")
}
Or "rename" the function:
import "fmt"
var Println = fmt.Println
func main() {
Println("Hello World")
}
Or use .
as alias (it may be what you would like most):
import . "fmt"
func main() {
Println("Hello World")
}
Note that in that case, the alias is not blank. From the specifications of Go:
A qualified identifier is an identifier qualified with a package name prefix. Both the package name and the identifier must not be blank.
QualifiedIdent = PackageName "." identifier .
And another example from the same specifications:
import "lib/math" math.Sin
import m "lib/math" m.Sin
import . "lib/math" Sin