go icon indicating copy to clipboard operation
go copied to clipboard

Marshal failure with Go 1.24 rc and GOARCH=386

Open bboreham opened this issue 11 months ago • 2 comments

I filed this as a Go bug since it is architecture-specific, but cross-posting here for visibility:

https://github.com/golang/go/issues/71408

This code:

type Metadata struct {
	Type string `json:"type"`
}

func TestJsonIter(t *testing.T) {
	m := map[string][]Metadata{"item1": []Metadata{{Type: "gauge"}}, "item2": []Metadata{{Type: "summary"}}}
	json := jsoniter.ConfigCompatibleWithStandardLibrary
	s, err := json.Marshal(m)
	if err != nil {
		t.FailNow()
	}
	if len(s) < 40 {
		t.Errorf("Result too short (%d): %q", len(s), s)
	}
}

will get just one item in the output and fail the test, when run with GOARCH=386 and Go 1.24rc2.

bboreham avatar Jan 23 '25 18:01 bboreham

xref: https://github.com/modern-go/reflect2/issues/32

dims avatar Jun 14 '25 22:06 dims

111

HQB322 avatar Sep 06 '25 08:09 HQB322