I tried below JSON for decoding using json package. which has hyphen/dash
{ “user-name”: “ram”}
structure i have defined as below
type user struct {
Username string json:”user-name”
}
surprisingly it’s not able to decode the value. what is the reason behind this ? and how i can decode it to structure and access the value in GO. because this is third party legacy format which i cant change.