I am using this code to connect jsonrpc to bitcoin:
package main
import "rpc/jsonrpc"
import "fmt"
func main() {
rc, e := jsonrpc.Dial("tcp", "user:pass@localhost:8332")
if e != nil {fmt.Print(e);return;}
var blocks float64
rc.Call("getblockcount", "", &blocks)
if e != nil {fmt.Print(e); return;}
fmt.Print("%f blocks", blocks)
}
When I execute it, I get the following error:
dial tcp user:pass@localhost:8332: too many colons in address user:pass@localhost:8332