golint cleanup
Siraj Ravel committed
Sep 11, 2014 at 12:25 UTC
b88ee2870ac3e64a3f537b5716aae11ee27195eb
4 files changed
+10
-10
cmd/ipfs/init.go
+1
-1
@@ -68,7 +68,7 @@ func initCmd(c *commander.Command, inp []string) error {
68
}
69
cfg.Identity.PrivKey = base64.StdEncoding.EncodeToString(skbytes)
70
71
- id, err := identify.IdFromPubKey(pk)
71
+ id, err := identify.IDFromPubKey(pk)
72
if err != nil {
73
return err
74
}
identify/identify.go
+5
-5
@@ -1,4 +1,4 @@
1
-// The identify package handles how peers identify with eachother upon
1
+// Package identify handles how peers identify with eachother upon
2
// connection to the network
3
package identify
4
@@ -31,7 +31,7 @@ var SupportedHashes = "SHA256,SHA512,SHA1"
31
// ErrUnsupportedKeyType is returned when a private key cast/type switch fails.
32
var ErrUnsupportedKeyType = errors.New("unsupported key type")
33
34
-// Perform initial communication with this peer to share node ID's and
34
+// Performs initial communication with this peer to share node ID's and
35
// initiate communication. (secureIn, secureOut, error)
36
func Handshake(self, remote *peer.Peer, in, out chan []byte) (chan []byte, chan []byte, error) {
37
// Generate and send Hello packet.
@@ -74,7 +74,7 @@ func Handshake(self, remote *peer.Peer, in, out chan []byte) (chan []byte, chan
74
return nil, nil, err
75
}
76
77
- remote.ID, err = IdFromPubKey(remote.PubKey)
77
+ remote.ID, err = IDFromPubKey(remote.PubKey)
78
if err != nil {
79
return nil, nil, err
80
}
@@ -238,8 +238,8 @@ func secureOutProxy(out, secureOut chan []byte, hashType string, mIV, mCKey, mMK
238
out <- buff
239
}
240
}
241
-
242
-func IdFromPubKey(pk ci.PubKey) (peer.ID, error) {
241
+// IDFromPubKey returns Nodes ID given its public key
242
+func IDFromPubKey(pk ci.PubKey) (peer.ID, error) {
243
b, err := pk.Bytes()
244
if err != nil {
245
return nil, err
identify/identify_test.go
+2
-2
@@ -20,7 +20,7 @@ func TestHandshake(t *testing.T) {
20
cha := make(chan []byte, 5)
21
chb := make(chan []byte, 5)
22
23
- ida, err := IdFromPubKey(pka)
23
+ ida, err := IDFromPubKey(pka)
24
if err != nil {
25
t.Fatal(err)
26
}
@@ -30,7 +30,7 @@ func TestHandshake(t *testing.T) {
30
PrivKey: ska,
31
}
32
33
- idb, err := IdFromPubKey(pkb)
33
+ idb, err := IDFromPubKey(pkb)
34
if err != nil {
35
t.Fatal(err)
36
}
routing/dht/dht_test.go
+2
-2
@@ -35,7 +35,7 @@ func setupDHTS(n int, t *testing.T) ([]*ma.Multiaddr, []*peer.Peer, []*IpfsDHT)
35
}
36
p.PubKey = pk
37
p.PrivKey = sk
38
- id, err := identify.IdFromPubKey(pk)
38
+ id, err := identify.IDFromPubKey(pk)
39
if err != nil {
40
panic(err)
41
}
@@ -67,7 +67,7 @@ func makePeer(addr *ma.Multiaddr) *peer.Peer {
67
}
68
p.PrivKey = sk
69
p.PubKey = pk
70
- id, err := identify.IdFromPubKey(pk)
70
+ id, err := identify.IDFromPubKey(pk)
71
if err != nil {
72
panic(err)
73
}