github.com/shogo82148/std@v1.22.1-0.20240327122250-4e474527810c/runtime/debuglog_test.go (about) 1 // Copyright 2019 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // TODO(austin): All of these tests are skipped if the debuglog build 6 // tag isn't provided. That means we basically never test debuglog. 7 // There are two potential ways around this: 8 // 9 // 1. Make these tests re-build the runtime test with the debuglog 10 // build tag and re-invoke themselves. 11 // 12 // 2. Always build the whole debuglog infrastructure and depend on 13 // linker dead-code elimination to drop it. This is easy for dlog() 14 // since there won't be any calls to it. For printDebugLog, we can 15 // make panic call a wrapper that is call printDebugLog if the 16 // debuglog build tag is set, or otherwise do nothing. Then tests 17 // could call printDebugLog directly. This is the right answer in 18 // principle, but currently our linker reads in all symbols 19 // regardless, so this would slow down and bloat all links. If the 20 // linker gets more efficient about this, we should revisit this 21 // approach. 22 23 package runtime_test