一応以下でできました
main.go
package main
import (
"encoding/json"
"fmt"
)
func myfunc(num json.Number) {
id, _ := num.Int64()
fmt.Print(int(id))
}
int64に変換できるのがポイントです。
数値型にも色々あってちゃんと理解してないとはまりますね。
More than 5 years have passed since last update.
一応以下でできました
package main
import (
"encoding/json"
"fmt"
)
func myfunc(num json.Number) {
id, _ := num.Int64()
fmt.Print(int(id))
}
int64に変換できるのがポイントです。
数値型にも色々あってちゃんと理解してないとはまりますね。
Register as a new user and use Qiita more conveniently