mholt / json-to-go

Translates JSON into a Go type in your browser instantly (original)
https://mholt.github.io/json-to-go/
MIT License
4.48k stars 473 forks source link

JSON key "2.0" gets converted to "2.1" struct tag #104

Closed madislohmus closed 2 years ago

madislohmus commented 2 years ago

Input {"2.0":"asdg"} gets converted to:

type AutoGenerated struct {
    Two1 string `json:"2.1"`
}
mholt commented 2 years ago

Can't reproduce:

{"2.0":"asdg"}

yields

type AutoGenerated struct {
    Two0 string `json:"2.0"`
}
madislohmus commented 2 years ago

Sorry, just checked and it only happens with chrome and when I'm logged in. Doesn't happen in incognito, or using chrome as a guest or in Safari. Just to show that I'm not completely crazy:

https://user-images.githubusercontent.com/6338873/154111894-9e59c37f-70f4-4f6f-a871-e0eab479408b.mov

mholt commented 2 years ago

That's bizarre. Logged in to what? There's no login on the site. Or do you mean logged into the Chrome browser itself?

Are you sure you've cleared your cache and stuff?

madislohmus commented 2 years ago

Logged into Chrome browser, if that makes sense. It is a work managed laptop and we're using g-suite, etc... So I tried first removing all extensions, clearing cache, but finally clearing all cookies and browsing history made it work again. Super weird behaviour in any case. Sorry for the confusion.