Browse Source

msgpack.org.md: added go syntax highlighting to code snippet.

Ugorji Nwoke 12 years ago
parent
commit
1fd0b0223b
1 changed files with 7 additions and 4 deletions
  1. 7 4
      msgpack.org.md

+ 7 - 4
msgpack.org.md

@@ -12,12 +12,14 @@ Online documentation: [http://godoc.org/github.com/ugorji/go/codec]
 
 
 Typical usage:
 Typical usage:
 
 
+```go
     // create and use decoder/encoder
     // create and use decoder/encoder
     var (
     var (
-      r io.Reader
-      w io.Writer
-      b []byte
-      mh codec.MsgpackHandle
+        v interface{} // value to decode/encode into
+        r io.Reader
+        w io.Writer
+        b []byte
+        mh codec.MsgpackHandle
     )
     )
     
     
     dec = codec.NewDecoder(r, &mh)
     dec = codec.NewDecoder(r, &mh)
@@ -42,3 +44,4 @@ Typical usage:
     conn, err = net.Dial("tcp", "localhost:5555")
     conn, err = net.Dial("tcp", "localhost:5555")
     rpcCodec := rpcH.ClientCodec(conn, h)
     rpcCodec := rpcH.ClientCodec(conn, h)
     client := rpc.NewClientWithCodec(rpcCodec)
     client := rpc.NewClientWithCodec(rpcCodec)
+```