1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-24 04:16:27 +02:00
Carlos Alexandro Becker 69767ec798
improvements
2017-04-19 17:05:10 -03:00

33 lines
634 B
Go

package release
import (
"bytes"
"html/template"
"os/exec"
"github.com/goreleaser/goreleaser/context"
)
const bodyTemplate = `{{ .ReleaseNotes }}
---
Automated with @goreleaser
Built with {{ .GoVersion }}
`
func buildBody(ctx *context.Context) (bytes.Buffer, error) {
var out bytes.Buffer
bts, err := exec.Command("go", "version").CombinedOutput()
if err != nil {
return out, err
}
var template = template.Must(template.New("release").Parse(bodyTemplate))
err = template.Execute(&out, struct {
ReleaseNotes, GoVersion string
}{
ReleaseNotes: ctx.ReleaseNotes,
GoVersion: string(bts),
})
return out, err
}