Yes you can: https://doc.rust-lang.org/std/ptr/fn.null.html
You just won't use it unless you're doing FFI or similar things.
I meant "using null pointer" means dereference it. But careless language....
/*
int g() {
volatile int x;
return x;
}
*/
import "C"
import "fmt"
func main() {
fmt.Printf("%d\n", C.g())
}
But I know you'll say that 'import "C"' or 'import "unsafe"' is the same thing as using an unsafe block in rust or such, and really shouldn't count against go.Which is fair and true, but you're chasing down a pointless detail. The point isn't that go is memory unsafe. It's not. The point is that Go's type-system is not powerful enough to express various types of type-safety, and as such it's an error-prone language where you can expect null pointer exceptions frequently.
Still. Rust is infinitely better in this regard. Go feels like a crude hammer, especially regarding the default interaction between deserialization and missing struct members.
There are other, very convincingly better options to this that many in this thread have been trying to teach you about in the expectation that your responses have been in good faith.
I am a Rust novice but I have not found a way to get to uninitialised memory in safe Rust. Yet.