Package heredoc provides the here-document with keeping indent.
import "github.com/MakeNowJust/heredoc/v2"
package main
import (
"fmt"
"github.com/MakeNowJust/heredoc/v2"
)
func main() {
fmt.Println(heredoc.Doc(`
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, ...
`))
// Output:
// Lorem ipsum dolor sit amet, consectetur adipisicing elit,
// sed do eiusmod tempor incididunt ut labore et dolore magna
// aliqua. Ut enim ad minim veniam, ...
//
}
heredoc package - github.com/MakeNowJust/heredoc/v2 - pkg.go.dev
This software is released under the MIT License, see LICENSE.