Skip to content
This repository has been archived by the owner on Aug 2, 2021. It is now read-only.

Commit

Permalink
Merge pull request #5 from sdboyer/iotas
Browse files Browse the repository at this point in the history
Idiomatic go: use iotas for const declarations
  • Loading branch information
obscuren committed Feb 19, 2014
2 parents 3dae732 + 357b4bc commit 531b3a9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions ethwire/messaging.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ var MagicToken = []byte{34, 64, 8, 145}
type MsgType byte

const (
// Values are given explicitly instead of by iota because these values are
// defined by the wire protocol spec; it is easier for humans to ensure
// correctness when values are explicit.
MsgHandshakeTy = 0x00
MsgDiscTy = 0x01
MsgPingTy = 0x02
Expand Down
9 changes: 6 additions & 3 deletions peer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ const (
type DiscReason byte

const (
// Values are given explicitly instead of by iota because these values are
// defined by the wire protocol spec; it is easier for humans to ensure
// correctness when values are explicit.
DiscReRequested = 0x00
DiscReTcpSysErr = 0x01
DiscBadProto = 0x02
Expand Down Expand Up @@ -56,9 +59,9 @@ func (d DiscReason) String() string {
type Caps byte

const (
CapPeerDiscTy = 0x01
CapTxTy = 0x02
CapChainTy = 0x04
CapPeerDiscTy = 1 << iota
CapTxTy
CapChainTy

CapDefault = CapChainTy | CapTxTy | CapPeerDiscTy
)
Expand Down

0 comments on commit 531b3a9

Please sign in to comment.