The Go language declares a variable of a multi line string


How does Go declare a variable of a multi-line string ? Use ‘to include.

package main

import (
  "fmt"
)

func main() {
  str := `hello
world
v2.0`
  fmt.Println(str)
}

Demo: http: / / play. golang. org/p/BOL8_SwQ0D

That’s all for this article, I hope you enjoy it.