github.com/droot/goreleaser@v0.66.2-0.20180420030140-c2db5fb17157/internal/deprecate/deprecate.go (about) 1 // Package deprecate provides simple functions to standardize the output 2 // of deprecation notices on goreleaser 3 package deprecate 4 5 import ( 6 "strings" 7 8 "github.com/apex/log" 9 "github.com/apex/log/handlers/cli" 10 "github.com/fatih/color" 11 ) 12 13 const baseURL = "https://goreleaser.com/#deprecation_notices." 14 15 // Notice warns the user about the deprecation of the given property 16 func Notice(property string) { 17 cli.Default.Padding += 3 18 defer func() { 19 cli.Default.Padding -= 3 20 }() 21 url := baseURL + strings.Replace(property, ".", "_", -1) 22 log.Warn(color.New(color.Bold, color.FgHiYellow).Sprintf( 23 "DEPRECATED: `%s` should not be used anymore, check %s for more info.", 24 property, 25 url, 26 )) 27 }