Skip to main content

String Data Type

Text in Go is held by the string type, which is simply a series of characters. To write a string value, put it between double quotes.

Example

Prompt
Declare string variables in three ways: typed with value, typed without value, and short declaration. Print the type and value of each.
Output: Go program and captured output