1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-08 03:31:59 +02:00
goreleaser/internal/deprecate/deprecate.go
Carlos Alexandro Becker 0694b46bcc
fix: better deprecation notices (#561)
* fix: better deprecation notices

* test: covered deprecate with tests

* docs: improved docs

* docs: improved docs

* chore: organize imports

* style: code improve
2018-02-17 13:43:29 -02:00

28 lines
695 B
Go

// Package deprecate provides simple functions to standardize the output
// of deprecation notices on goreleaser
package deprecate
import (
"strings"
"github.com/apex/log"
"github.com/apex/log/handlers/cli"
"github.com/fatih/color"
)
const baseURL = "https://goreleaser.com/#deprecation_notices."
// Notice warns the user about the deprecation of the given property
func Notice(property string) {
cli.Default.Padding += 3
defer func() {
cli.Default.Padding -= 3
}()
url := baseURL + strings.Replace(property, ".", "_", -1)
log.Warn(color.New(color.Bold, color.FgHiYellow).Sprintf(
"DEPRECATED: `%s` should not be used anymore, check %s for more info.",
property,
url,
))
}