multi line strings



Use back ticks, instead of the usual double quotes

package main
import "fmt"

func main() {
    longString :=
    `this is
    a very, very
    very long string
    notice the back ticks`
    fmt.Println(longString)
}

No comments:

Post a Comment