func WithGoBuildInformation()

in monitoring/start_options.go [89:107]


func WithGoBuildInformation(info *debug.BuildInfo) Option {
	return func(config *optionsConfig) {
		config.buildInfoGaugeLabels[buildInfoGoVersionLabel] = info.GoVersion
		config.buildInfoGaugeLabels[buildInfoModulePathLabel] = info.Path
		config.buildInfoGaugeLabels[buildInfoModuleVersionLabel] = info.Main.Version

		for _, setting := range info.Settings {
			switch setting.Key {
			case "vcs.revision":
				config.buildInfoGaugeLabels[buildInfoVersionLabel] = setting.Value
				config.version = setting.Value
			case "vcs.modified":
				config.buildInfoGaugeLabels[buildInfoModifiedLabel] = setting.Value
			case "vcs.time":
				config.buildInfoGaugeLabels[buildInfoCommittedLabel] = setting.Value
			}
		}
	}
}