From 7a7fa56407005328f81440869a533d0ca486baae Mon Sep 17 00:00:00 2001 From: "John C. Vernaleo" Date: Tue, 13 Aug 2013 17:01:38 -0400 Subject: [PATCH] Make id an interface in CreateMessageWithId to match the struct better. --- jsonapi.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jsonapi.go b/jsonapi.go index 443afc66..271bae90 100644 --- a/jsonapi.go +++ b/jsonapi.go @@ -162,7 +162,7 @@ type Error struct { // jsonWithArgs takes a command, an id, and an interface which contains an // array of the arguments for that command. It knows NOTHING about the commands // so all error checking of the arguments must happen before it is called. -func jsonWithArgs(command string, id string, args interface{}) ([]byte, error) { +func jsonWithArgs(command string, id interface{}, args interface{}) ([]byte, error) { rawMessage := Message{"1.0", id, command, args} finalMessage, err := json.Marshal(rawMessage) if err != nil { @@ -188,7 +188,7 @@ func CreateMessage(message string, args ...interface{}) ([]byte, error) { // It is capable of handeling all of the commands from the standard client, // described at: // https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list -func CreateMessageWithId(message string, id string, args ...interface{}) ([]byte, error) { +func CreateMessageWithId(message string, id interface{}, args ...interface{}) ([]byte, error) { var finalMessage []byte var err error // Different commands have different required and optional arguments.