package main import ( "encoding/json" "fmt" "log" ) type response struct { Jsonrpc string `json:"jsonrpc"` Result interface{} `json:"result,string"` ID uint64 `json:"id"` } func someFunc(result interface{}) error { resBytes := []byte(`{"jsonrpc":"2.0","result":{"itemids":["24759"]},"id":3}`) res := response{Result: result} return json.Unmarshal(resBytes, &res) } func main() { var result struct { I