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.
10 import "runtime/debug"
12 func packageMainIsDevelModule() bool {
13 info, ok := debug.ReadBuildInfo()
15 // Most test binaries currently lack build info, but this should become more
16 // permissive once https://golang.org/issue/33976 is fixed.
20 // Note: info.Main.Version describes the version of the module containing
21 // package main, not the version of “the main module”.
22 // See https://golang.org/issue/33975.
23 return info.Main.Version == "(devel)"
27 packageMainIsDevel = packageMainIsDevelModule