← BYTES
Go·Starter·Ref: 10.1.4

What is the zero value of a string variable in Go?

Have a question about this video? Mention reference 10.1.4 when you contact us.

a.An empty string ""
b.nil
c.The literal text "null"
d.A compile error -- strings must always be explicitly initialized
Go's zero value for string is the empty string "", not nil -- strings in Go are not pointer types in the way maps, slices, and interfaces are, so there is no nil string; len("") is simply 0.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES1014#Go