mirror of
https://github.com/goreleaser/nfpm
synced 2024-05-24 18:26:13 +02:00
2a86957187
* feat: add deprecation notice interface * fix: use a simple writer * fix: use println
19 lines
375 B
Go
19 lines
375 B
Go
package deprecation
|
|
|
|
import (
|
|
"bytes"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestNotice(t *testing.T) {
|
|
Print("before")
|
|
var b bytes.Buffer
|
|
Noticer = prefixed{&b}
|
|
Print("blah\n")
|
|
Printf("blah: %v\n", true)
|
|
Println("foobar")
|
|
require.Equal(t, "DEPRECATION WARNING: blah\nDEPRECATION WARNING: blah: true\nDEPRECATION WARNING: foobar\n", b.String())
|
|
}
|