1
1
mirror of https://github.com/goreleaser/nfpm synced 2025-11-14 08:07:16 +01:00
nfpm/deprecation/deprecation.go
2025-03-29 08:57:48 -03:00

32 lines
672 B
Go

// 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 ...any) {
fmt.Fprintf(Noticer, format, a...)
}