1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-24 04:16:27 +02:00
Carlos Alexandro Becker eb19e2b5d9 refactor: rm internal/name pkg
Each pipe now does its own templating
2017-12-03 13:00:01 -02:00

25 lines
494 B
Go

package client
import (
"bytes"
"text/template"
"github.com/goreleaser/goreleaser/context"
)
func releaseTitle(ctx *context.Context) (string, error) {
var out bytes.Buffer
t, err := template.New("github").Parse(ctx.Config.Release.NameTemplate)
if err != nil {
return "", err
}
err = t.Execute(&out, struct {
ProjectName, Tag, Version string
}{
ProjectName: ctx.Config.ProjectName,
Tag: ctx.Git.CurrentTag,
Version: ctx.Version,
})
return out.String(), err
}