logtail, logpolicy: remove an unidiomatic use of an interface

This commit is contained in:
Brad Fitzpatrick
2020-12-21 09:03:39 -08:00
parent 83f45ae2dd
commit d97ee12179
4 changed files with 40 additions and 48 deletions

View File

@ -14,7 +14,7 @@ func TestFastShutdown(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
cancel()
l := Log(Config{
l := NewLogger(Config{
BaseURL: "http://localhost:1234",
}, t.Logf)
l.Shutdown(ctx)
@ -23,7 +23,7 @@ func TestFastShutdown(t *testing.T) {
var sink []byte
func TestLoggerEncodeTextAllocs(t *testing.T) {
lg := &logger{timeNow: time.Now}
lg := &Logger{timeNow: time.Now}
inBuf := []byte("some text to encode")
n := testing.AllocsPerRun(1000, func() {
sink = lg.encodeText(inBuf, false)
@ -34,7 +34,7 @@ func TestLoggerEncodeTextAllocs(t *testing.T) {
}
func TestLoggerWriteLength(t *testing.T) {
lg := &logger{
lg := &Logger{
timeNow: time.Now,
buffer: NewMemoryBuffer(1024),
}