ПК
Size: a a a
ПК
ВС
p
ПК
D🦆
AE
DP
а
D
АИ
package main
import (
"encoding/json"
"fmt"
)
type Tstruct struct {
BigNum int `json:"Id,string"`
}
func main() {
var a Tstruct
err := json.Unmarshal([]byte(`{"Id":"33320603219206027"}`), &a)
if err != nil {
panic(err)
}
fmt.Println(a)
}
anic: json: cannot unmarshal number 33320603219206027 into Go struct field Tstruct.Id of type int
я понимаю можно заменить типа на string. Может есть правильный способ?/
package main
import (
"encoding/json"
"fmt"
)
type Tstruct struct {
BigNum int `json:"Id,string"`
}
func main() {
var a Tstruct
err := json.Unmarshal([]byte(`{"Id":"33320603219206027"}`), &a)
if err != nil {
panic(err)
}
fmt.Println(a)
}
anic: json: cannot unmarshal number 33320603219206027 into Go struct field Tstruct.Id of type int
я понимаю можно заменить типа на string. Может есть правильный способ?/
/
АИ
/
/
ВЩ
ВЩ
A
package main
import (
"encoding/json"
"fmt"
)
type Tstruct struct {
BigNum int `json:"Id,string"`
}
func main() {
var a Tstruct
err := json.Unmarshal([]byte(`{"Id":"33320603219206027"}`), &a)
if err != nil {
panic(err)
}
fmt.Println(a)
}
anic: json: cannot unmarshal number 33320603219206027 into Go struct field Tstruct.Id of type int
я понимаю можно заменить типа на string. Может есть правильный способ?