Commit c56a25e2 authored by rht's avatar rht

Run 'gofmt -s -w' on these files

parent ca42d82f
......@@ -215,7 +215,7 @@ func TestProvides(t *testing.T) {
}
}
for k, _ := range testCaseValues {
for k := range testCaseValues {
log.Debugf("announcing provider for %s", k)
if err := dhts[3].Provide(ctx, k); err != nil {
t.Fatal(err)
......@@ -226,7 +226,7 @@ func TestProvides(t *testing.T) {
time.Sleep(time.Millisecond * 6)
n := 0
for k, _ := range testCaseValues {
for k := range testCaseValues {
n = (n + 1) % 3
log.Debugf("getting providers for %s from %d", k, n)
......@@ -521,7 +521,7 @@ func TestProvidesMany(t *testing.T) {
}
}
for k, _ := range testCaseValues {
for k := range testCaseValues {
// everyone should be able to find it...
for _, dht := range dhts {
log.Debugf("getting providers for %s at %s", k, dht.self)
......
......@@ -77,7 +77,7 @@ func (pm *ProviderManager) run() {
case lc := <-pm.getlocal:
var keys []u.Key
for k, _ := range pm.local {
for k := range pm.local {
keys = append(keys, k)
}
lc <- keys
......
......@@ -10,9 +10,9 @@ import (
func TestPrefixLen(t *testing.T) {
cases := [][]byte{
[]byte{0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00},
[]byte{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
[]byte{0x00, 0x58, 0xFF, 0x80, 0x00, 0x00, 0xF0},
{0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x00, 0x58, 0xFF, 0x80, 0x00, 0x00, 0xF0},
}
lens := []int{24, 56, 9}
......@@ -28,15 +28,15 @@ func TestPrefixLen(t *testing.T) {
func TestXorKeySpace(t *testing.T) {
ids := [][]byte{
[]byte{0xFF, 0xFF, 0xFF, 0xFF},
[]byte{0x00, 0x00, 0x00, 0x00},
[]byte{0xFF, 0xFF, 0xFF, 0xF0},
{0xFF, 0xFF, 0xFF, 0xFF},
{0x00, 0x00, 0x00, 0x00},
{0xFF, 0xFF, 0xFF, 0xF0},
}
ks := [][2]Key{
[2]Key{XORKeySpace.Key(ids[0]), XORKeySpace.Key(ids[0])},
[2]Key{XORKeySpace.Key(ids[1]), XORKeySpace.Key(ids[1])},
[2]Key{XORKeySpace.Key(ids[2]), XORKeySpace.Key(ids[2])},
{XORKeySpace.Key(ids[0]), XORKeySpace.Key(ids[0])},
{XORKeySpace.Key(ids[1]), XORKeySpace.Key(ids[1])},
{XORKeySpace.Key(ids[2]), XORKeySpace.Key(ids[2])},
}
for i, set := range ks {
......@@ -75,12 +75,12 @@ func TestXorKeySpace(t *testing.T) {
func TestDistancesAndCenterSorting(t *testing.T) {
adjs := [][]byte{
[]byte{173, 149, 19, 27, 192, 183, 153, 192, 177, 175, 71, 127, 177, 79, 207, 38, 166, 169, 247, 96, 121, 228, 139, 240, 144, 172, 183, 232, 54, 123, 253, 14},
[]byte{223, 63, 97, 152, 4, 169, 47, 219, 64, 87, 25, 45, 196, 61, 215, 72, 234, 119, 138, 220, 82, 188, 73, 140, 232, 5, 36, 192, 20, 184, 17, 25},
[]byte{73, 176, 221, 176, 149, 143, 22, 42, 129, 124, 213, 114, 232, 95, 189, 154, 18, 3, 122, 132, 32, 199, 53, 185, 58, 157, 117, 78, 52, 146, 157, 127},
[]byte{73, 176, 221, 176, 149, 143, 22, 42, 129, 124, 213, 114, 232, 95, 189, 154, 18, 3, 122, 132, 32, 199, 53, 185, 58, 157, 117, 78, 52, 146, 157, 127},
[]byte{73, 176, 221, 176, 149, 143, 22, 42, 129, 124, 213, 114, 232, 95, 189, 154, 18, 3, 122, 132, 32, 199, 53, 185, 58, 157, 117, 78, 52, 146, 157, 126},
[]byte{73, 0, 221, 176, 149, 143, 22, 42, 129, 124, 213, 114, 232, 95, 189, 154, 18, 3, 122, 132, 32, 199, 53, 185, 58, 157, 117, 78, 52, 146, 157, 127},
{173, 149, 19, 27, 192, 183, 153, 192, 177, 175, 71, 127, 177, 79, 207, 38, 166, 169, 247, 96, 121, 228, 139, 240, 144, 172, 183, 232, 54, 123, 253, 14},
{223, 63, 97, 152, 4, 169, 47, 219, 64, 87, 25, 45, 196, 61, 215, 72, 234, 119, 138, 220, 82, 188, 73, 140, 232, 5, 36, 192, 20, 184, 17, 25},
{73, 176, 221, 176, 149, 143, 22, 42, 129, 124, 213, 114, 232, 95, 189, 154, 18, 3, 122, 132, 32, 199, 53, 185, 58, 157, 117, 78, 52, 146, 157, 127},
{73, 176, 221, 176, 149, 143, 22, 42, 129, 124, 213, 114, 232, 95, 189, 154, 18, 3, 122, 132, 32, 199, 53, 185, 58, 157, 117, 78, 52, 146, 157, 127},
{73, 176, 221, 176, 149, 143, 22, 42, 129, 124, 213, 114, 232, 95, 189, 154, 18, 3, 122, 132, 32, 199, 53, 185, 58, 157, 117, 78, 52, 146, 157, 126},
{73, 0, 221, 176, 149, 143, 22, 42, 129, 124, 213, 114, 232, 95, 189, 154, 18, 3, 122, 132, 32, 199, 53, 185, 58, 157, 117, 78, 52, 146, 157, 127},
}
keys := make([]Key, len(adjs))
......
......@@ -86,7 +86,7 @@ func (c *Client) Provide(ctx context.Context, k u.Key) error {
msg := pb.NewMessage(pb.Message_ADD_PROVIDER, string(k), 0)
// FIXME how is connectedness defined for the local node
pri := []pb.PeerRoutingInfo{
pb.PeerRoutingInfo{
{
PeerInfo: peer.PeerInfo{
ID: c.local,
Addrs: c.peerhost.Addrs(),
......
......@@ -73,7 +73,7 @@ func (s *Server) handleMessage(
case dhtpb.Message_FIND_NODE:
p := s.peerstore.PeerInfo(peer.ID(req.GetKey()))
pri := []dhtpb.PeerRoutingInfo{
dhtpb.PeerRoutingInfo{
{
PeerInfo: p,
// Connectedness: TODO
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment