Does Go have anything similar to Python\'s multiline strings:
\"\"\"line 1
line 2
line 3\"\"\"
From String literals:
\n
'. But, if your multi-line string has to include a backquote (`), then you will have to use an interpreted string literal:
`line one
line two ` +
"`" + `line three
line four`
You cannot directly put a backquote (`) in a raw string literal (``xx\
).
You have to use (as explained in "how to put a backquote in a backquoted string?"):
+ "`" + ...
you can use raw literals. Example
s:=`stack
overflow`
For me this is what I use if adding \n
is not a problem.
fmt.Sprintf("Hello World\nHow are you doing today\nHope all is well with your go\nAnd code")
Else you can use the raw string
multiline := `Hello Brothers and sisters of the Code
The grail needs us.
`