-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Closed
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.release-blocker
Milestone
Description
go1.18 added MarshalText and UnmarshalText methods for BuildInfo.
https://pkg.go.dev/runtime/debug@go1.18beta2#BuildInfo
This addition changed the behavior of this program.
package main
import (
"encoding/json"
"fmt"
"runtime/debug"
)
func main() {
info, _ := debug.ReadBuildInfo()
b, _ := json.MarshalIndent(info, " ", " ")
fmt.Printf("%s\n", b)
}
With go1.17
{
"Path": "example",
"Main": {
"Path": "example",
"Version": "(devel)",
"Sum": "",
"Replace": null
},
"Deps": null
}
With go1.18
"go\tgo1.18beta2\npath\texample\nmod\texample\t(devel)\t\nbuild\t-compiler=gc\nbuild\t-gcflags=all=-N -l\nbuild\tCGO_ENABLED=1\nbuild\tCGO_CFLAGS=-O0 -g\nbuild\tCGO_CPPFLAGS=\nbuild\tCGO_CXXFLAGS=\nbuild\tCGO_LDFLAGS=\nbuild\tGOARCH=amd64\nbuild\tGOOS=darwin\nbuild\tGOAMD64=v1\n"
My proposal is either drop MarshalText/UnmarshalText (instead String/Parse, Encode/Decode?), or provide MarshalJSON/UnmarshalJSON so JSON encoding can encode in a form that tools written in other languages can access the info easily.
ericlagergren and AlekSi
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.The path to resolution is known, but the work has not been done.release-blocker