1
1
mirror of https://github.com/goreleaser/nfpm synced 2024-11-19 07:34:48 +01:00
nfpm/deprecation/deprecation.go

32 lines
680 B
Go
Raw Normal View History

// Package deprecation provides centralized deprecation notice messaging for nfpm.
package deprecation
import (
"fmt"
"io"
"os"
)
type prefixed struct{ io.Writer }
func (p prefixed) Write(b []byte) (int, error) {
return p.Writer.Write(append([]byte("DEPRECATION WARNING: "), b...))
}
var Noticer io.Writer = prefixed{os.Stderr}
// Print prints the given string to the Noticer.
func Print(s string) {
fmt.Fprint(Noticer, s)
}
// Println printslns the given string to the Noticer.
func Println(s string) {
fmt.Fprintln(Noticer, s)
}
// Printf printfs the given string to the Noticer.
func Printf(format string, a ...interface{}) {
fmt.Fprintf(Noticer, format, a...)
}