【发布时间】:2015-01-23 15:42:05
【问题描述】:
缩进原始字符串文字的建议样式是什么?如果我根据它的第一行缩进它,它可能无法在具有不同制表符长度的编辑器中正确对齐。例如:
if select == nil {
select, err = db.Prepare(`select name
from table
where id=$1`)
if err != nil {
return nil, err
}
}
我找到了这个问题,但我还是不清楚:Best practice for long string literals in Go
我应该像下面那样做吗?
if select == nil {
select, err = db.Prepare(`
select name
from table
where id=$1`)
if err != nil {
return nil, err
}
}
【问题讨论】:
标签: go