From 9db7db54b0e84d6b3ace94cb1f2a42e065575f17 Mon Sep 17 00:00:00 2001 From: Colin Arnott Date: Thu, 22 Oct 2020 22:16:01 +0000 Subject: log: expose std via new Default function To allow passing around the package level *Logger, it is now exposed to callers of the Default function. We considered exposing std, however at this time there is no need to allow callers to replace std only pass and call methods directly. Fixes #39057 Change-Id: I710b16a3aa5e4e878870561dbf59560f98d8d09a Reviewed-on: https://go-review.googlesource.com/c/go/+/264460 Run-TryBot: Ian Lance Taylor TryBot-Result: Go Bot Reviewed-by: Ian Lance Taylor Trust: Alberto Donizetti --- src/log/log_test.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/log/log_test.go') diff --git a/src/log/log_test.go b/src/log/log_test.go index cdccbc554d..5be8e82258 100644 --- a/src/log/log_test.go +++ b/src/log/log_test.go @@ -74,6 +74,12 @@ func testPrint(t *testing.T, flag int, prefix string, pattern string, useFormat SetOutput(os.Stderr) } +func TestDefault(t *testing.T) { + if got := Default(); got != std { + t.Errorf("Default [%p] should be std [%p]", got, std) + } +} + func TestAll(t *testing.T) { for _, testcase := range tests { testPrint(t, testcase.flag, testcase.prefix, testcase.pattern, false) -- cgit v1.3