diff --git a/rpc/client_example_test.go b/rpc/client_example_test.go index 044b57a9c439..8dbeaf7d4821 100644 --- a/rpc/client_example_test.go +++ b/rpc/client_example_test.go @@ -28,7 +28,7 @@ import ( // In this example, our client wishes to track the latest 'block number' // known to the server. The server supports two methods: // -// eth_getBlockByNumber("latest", {}) +// eth_getBlockByNumber("latest", false) // returns the latest block object. // // eth_subscribe("newHeads") @@ -40,7 +40,11 @@ type Block struct { func ExampleClientSubscription() { // Connect the client. - client, _ := rpc.Dial("ws://127.0.0.1:8545") + client, err := rpc.Dial("ws://127.0.0.1:8545") + if err != nil { + fmt.Println("dial error:", err) + return + } subch := make(chan Block) // Ensure that subch receives the latest block.