From c630b6ca1fa86bead0d13f3e32fede47a40f32d3 Mon Sep 17 00:00:00 2001 From: "John C. Vernaleo" Date: Fri, 5 Sep 2014 13:44:04 -0400 Subject: [PATCH] Minor golint cleanups. --- internal_test.go | 6 +++--- jsonapi.go | 2 +- jsonfxns.go | 5 +++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/internal_test.go b/internal_test.go index cf041f8f..3116ec28 100644 --- a/internal_test.go +++ b/internal_test.go @@ -42,16 +42,16 @@ func TestJsonWithArgs(t *testing.T) { return } -// TestJsonRpcSend tests jsonRpcSend which actually send the rpc command. +// TestJsonRPCSend tests jsonRPCSend which actually send the rpc command. // This currently a negative test only until we setup a fake http server to // test the actually connection code. -func TestJsonRpcSend(t *testing.T) { +func TestJsonRPCSend(t *testing.T) { // Just negative test right now. user := "something" password := "something" server := "invalid" var message []byte - _, err := jsonRpcSend(user, password, server, message, false, nil, false) + _, err := jsonRPCSend(user, password, server, message, false, nil, false) if err == nil { t.Errorf("Should fail when it cannot connect.") } diff --git a/jsonapi.go b/jsonapi.go index c40d7f88..3720ce10 100644 --- a/jsonapi.go +++ b/jsonapi.go @@ -705,7 +705,7 @@ func rpcRawCommand(user string, password string, server string, err := fmt.Errorf("error, message does not appear to be valid json: %v", err) return result, err } - resp, err := jsonRpcSend(user, password, server, message, https, + resp, err := jsonRPCSend(user, password, server, message, https, certificates, skipverify) if err != nil { err := fmt.Errorf("error sending json message: " + err.Error()) diff --git a/jsonfxns.go b/jsonfxns.go index 98339a0c..df4a16b7 100644 --- a/jsonfxns.go +++ b/jsonfxns.go @@ -6,6 +6,7 @@ package btcjson import ( "bytes" + // Need to import this size it registers hash we need. _ "crypto/sha512" "crypto/tls" "crypto/x509" @@ -31,11 +32,11 @@ func MarshallAndSend(rawReply Reply, w io.Writer) (string, error) { return msg, nil } -// jsonRpcSend connects to the daemon with the specified username, password, +// jsonRPCSend connects to the daemon with the specified username, password, // and ip/port and then send the supplied message. This uses net/http rather // than net/rpc/jsonrpc since that one doesn't support http connections and is // therefore useless. -func jsonRpcSend(user string, password string, server string, message []byte, +func jsonRPCSend(user string, password string, server string, message []byte, https bool, certificates []byte, skipverify bool) (*http.Response, error) { client := &http.Client{} protocol := "http"