mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-01-26 04:22:05 +02:00
1ed299a6d7
Right now the code looks weird because the defaults of a pipe are far away of the implementation of the pipe. the intend of this PR is to bring them closer by having a Defaulter interface. I also renamed the Pipe interface to Piper, and removed the Description method in favor for fmt.Stringer.
21 lines
388 B
Go
21 lines
388 B
Go
package snapshot
|
|
|
|
import (
|
|
"github.com/goreleaser/goreleaser/context"
|
|
)
|
|
|
|
// Pipe for checksums
|
|
type Pipe struct{}
|
|
|
|
func (Pipe) String() string {
|
|
return "generating changelog"
|
|
}
|
|
|
|
// Default sets the pipe defaults
|
|
func (Pipe) Default(ctx *context.Context) error {
|
|
if ctx.Config.Snapshot.NameTemplate == "" {
|
|
ctx.Config.Snapshot.NameTemplate = "SNAPSHOT-{{ .Commit }}"
|
|
}
|
|
return nil
|
|
}
|