MCPcopy Create free account
hub / github.com/coder/envbuilder / find

Function find

buildinfo/version.go:32–46  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

30}
31
32func find(key string) (string, bool) {
33 readBuildInfo.Do(func() {
34 buildInfo, buildInfoValid = debug.ReadBuildInfo()
35 })
36 if !buildInfoValid {
37 panic("could not read build info")
38 }
39 for _, setting := range buildInfo.Settings {
40 if setting.Key != key {
41 continue
42 }
43 return setting.Value, true
44 }
45 return "", false
46}
47
48// Version returns the semantic version of the build.
49// Use golang.org/x/mod/semver to compare versions.

Callers 1

revisionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected