Example of initializing an array of strings in Go
This Go example program illustrates how to initialize an array of strings.
package main import ( "fmt" ) // Using var var validTags = []string{ "html", "body", "head", } func main() { // Using := stringarray := []string{ "fee", "fi", "fo", "fum", } for _, s := range (stringarray) { fmt.Println (s) } }
Copyright © Ben Bullock 2009-2024. All
rights reserved.
For comments, questions, and corrections, please email
Ben Bullock
(benkasminbullock@gmail.com).
/
Privacy /
Disclaimer