Data types in Golang. Here's a list of data types that you'll use in Golang: •The bool data type. It's used to store a set of Boolean truth values. It can either be true or false. •The string data type. A Golang string is implemented as a set of bytes that store a sequence of characters, using a given character encoding scheme. •The ...
Answer. The uninitialized pointer p in the main function is nil , and you can't follow the nil pointer. If x is nil, an attempt to evaluate *x will cause a run-time panic. The Go Programming Language Specification: Address operators. Since methods with pointer receivers take either a value or a pointer, you could also skip the pointer altogether: