I am integrating API and parsing its response in a structure. For this I need to declare field name as type
as API's response contains key
named type
. But when I declare type
in field name it gives me error:
syntax error: unexpected literal
type
, expecting field name or embedded type.
I don't know how to declare literal type
as struct field name.
My struct is
type Test struct {
active bool
name string
description string
amount int
currency string
type string
}