github.com/marianogappa/goreleaser@v0.26.2-0.20170715090149-96acd0a9fc46/pipeline/release/body.go (about) 1 package release 2 3 import ( 4 "bytes" 5 "os/exec" 6 "text/template" 7 8 "github.com/goreleaser/goreleaser/context" 9 ) 10 11 const bodyTemplate = `{{ .ReleaseNotes }} 12 13 --- 14 Automated with [GoReleaser](https://github.com/goreleaser) 15 Built with {{ .GoVersion }} 16 ` 17 18 func describeBody(ctx *context.Context) (bytes.Buffer, error) { 19 var out bytes.Buffer 20 bts, err := exec.Command("go", "version").CombinedOutput() 21 if err != nil { 22 return out, err 23 } 24 var template = template.Must(template.New("release").Parse(bodyTemplate)) 25 err = template.Execute(&out, struct { 26 ReleaseNotes, GoVersion string 27 }{ 28 ReleaseNotes: ctx.ReleaseNotes, 29 GoVersion: string(bts), 30 }) 31 return out, err 32 }