mirror of
https://github.com/btcsuite/btcd.git
synced 2024-11-19 09:50:08 +01:00
Fix doc example typo
This commit is contained in:
parent
335736e59f
commit
8679275090
2
doc.go
2
doc.go
@ -96,7 +96,7 @@ switch or type assertion. An example of a type switch follows:
|
||||
|
||||
// Assumes msg is already a valid concrete message such as one created
|
||||
// via NewMsgVersion or read via ReadMessage.
|
||||
switch msg.(type) {
|
||||
switch msg := msg.(type) {
|
||||
case *btcwire.MsgVersion:
|
||||
// The message is a pointer to a MsgVersion struct.
|
||||
fmt.Printf("Protocol version: %v", msg.ProtocolVersion)
|
||||
|
Loading…
Reference in New Issue
Block a user