find panics if a setting with the specific key was not found in the build info.
(key string)
| 155 | // find panics if a setting with the specific key was not |
| 156 | // found in the build info. |
| 157 | func find(key string) (string, bool) { |
| 158 | readBuildInfo.Do(func() { |
| 159 | buildInfo, buildInfoValid = debug.ReadBuildInfo() |
| 160 | }) |
| 161 | if !buildInfoValid { |
| 162 | panic("couldn't read build info") |
| 163 | } |
| 164 | for _, setting := range buildInfo.Settings { |
| 165 | if setting.Key != key { |
| 166 | continue |
| 167 | } |
| 168 | return setting.Value, true |
| 169 | } |
| 170 | return "", false |
| 171 | } |