indentation style for multi-line string literals
Considering both propositions would add newline or spaces to the litteral string, I would favor (even though fmt
format the first line):
select, err = db.Prepare(
`select name
from table
where id=$1`)
As the OP akonsu comments below, it seems consistent with the style of the golang code itself, as seen in src/cmd/go/main.go#L175
, which keeps the first line at the level of the opening '(
'
var usageTemplate = `Go is a tool for managing Go source code.
Usage:
go command [arguments]
...
`