github.com/goreleaser/nfpm/v2@v2.44.0/deprecation/deprecation.go (about)

     1  // Package deprecation provides centralized deprecation notice messaging for nfpm.
     2  package deprecation
     3  
     4  import (
     5  	"fmt"
     6  	"io"
     7  	"os"
     8  )
     9  
    10  type prefixed struct{ io.Writer }
    11  
    12  func (p prefixed) Write(b []byte) (int, error) {
    13  	return p.Writer.Write(append([]byte("DEPRECATION WARNING: "), b...))
    14  }
    15  
    16  var Noticer io.Writer = prefixed{os.Stderr}
    17  
    18  // Print prints the given string to the Noticer.
    19  func Print(s string) {
    20  	fmt.Fprint(Noticer, s)
    21  }
    22  
    23  // Println printslns the given string to the Noticer.
    24  func Println(s string) {
    25  	fmt.Fprintln(Noticer, s)
    26  }
    27  
    28  // Printf printfs the given string to the Noticer.
    29  func Printf(format string, a ...any) {
    30  	fmt.Fprintf(Noticer, format, a...)
    31  }