What version of Go are you using (go version)?
1.20
Does this issue reproduce with the latest release?
Yes
https://go.dev/play/p/_TMofzRghNL
package main
import "fmt"
const hello = `hello
`
func main() {
fmt.Println(hello)
}
./x.go:9:2: fmt.Println arg list ends with redundant newline
I understand the desire to complain if there is an explicit newline in the text to fmt.Println, but when it's coming from a constant like this, I need to change the constant or use Print instead of Println. I keep hitting this problem with old code that has a nice header to be printed that desires a blank line. Requiring me to close the constant before the newline seems excessively fussy to me.
What version of Go are you using (
go version)?Does this issue reproduce with the latest release?
Yes
https://go.dev/play/p/_TMofzRghNL
./x.go:9:2: fmt.Println arg list ends with redundant newline
I understand the desire to complain if there is an explicit newline in the text to fmt.Println, but when it's coming from a constant like this, I need to change the constant or use Print instead of Println. I keep hitting this problem with old code that has a nice header to be printed that desires a blank line. Requiring me to close the constant before the newline seems excessively fussy to me.