From 572c22f66ac70daa61a052d37c6be247e82794d4 Mon Sep 17 00:00:00 2001 From: Rajat Jindal Date: Sat, 20 May 2023 08:28:07 +0530 Subject: [PATCH] add Settings to debug.BuildInfo Signed-off-by: Rajat Jindal --- src/runtime/debug/debug.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/runtime/debug/debug.go b/src/runtime/debug/debug.go index fe3650cb..76311731 100644 --- a/src/runtime/debug/debug.go +++ b/src/runtime/debug/debug.go @@ -33,9 +33,17 @@ func ReadBuildInfo() (info *BuildInfo, ok bool) { // BuildInfo represents the build information read from // the running binary. type BuildInfo struct { - Path string // The main package path - Main Module // The module containing the main package - Deps []*Module // Module dependencies + Path string // The main package path + Main Module // The module containing the main package + Deps []*Module // Module dependencies + Settings []BuildSetting +} + +type BuildSetting struct { + // Key and Value describe the build setting. + // Key must not contain an equals sign, space, tab, or newline. + // Value must not contain newlines ('\n'). + Key, Value string } // Module represents a module.