5724: gofmt fixes.
authorTom Clegg <tom@curoverse.com>
Fri, 1 May 2015 07:13:47 +0000 (03:13 -0400)
committerTom Clegg <tom@curoverse.com>
Fri, 1 May 2015 07:13:47 +0000 (03:13 -0400)
services/keepstore/handler_test.go
services/keepstore/keepstore_test.go
services/keepstore/perms_test.go
services/keepstore/trash_worker_test.go
services/keepstore/volume.go
services/keepstore/volume_test.go
services/keepstore/volume_unix.go

index 71da956a1ae08be457983dc9719868ce3deba69a..5b65cd897fe353cfad0cf0e76047aeb73ac0d7cc 100644 (file)
@@ -228,13 +228,13 @@ func TestPutAndDeleteSkipReadonlyVolumes(t *testing.T) {
        IssueRequest(
                &RequestTester{
                        method:       "PUT",
-                       uri:          "/"+TEST_HASH,
+                       uri:          "/" + TEST_HASH,
                        request_body: TEST_BLOCK,
                })
        IssueRequest(
                &RequestTester{
                        method:       "DELETE",
-                       uri:          "/"+TEST_HASH,
+                       uri:          "/" + TEST_HASH,
                        request_body: TEST_BLOCK,
                        api_token:    data_manager_token,
                })
index a6e29f4759e09892f16ec35127acc1adf4212f18..88746745928053aad79e7f481b0c24fc7d741b8a 100644 (file)
@@ -345,7 +345,7 @@ func TestDiscoverTmpfs(t *testing.T) {
                        t.Errorf("Discover returned %s, expected %s\n",
                                resultVols[i].(*UnixVolume).root, tmpdir)
                }
-               if expectReadonly := i % 2 == 1; expectReadonly != resultVols[i].(*UnixVolume).readonly {
+               if expectReadonly := i%2 == 1; expectReadonly != resultVols[i].(*UnixVolume).readonly {
                        t.Errorf("Discover added %s with readonly=%v, should be %v",
                                tmpdir, !expectReadonly, expectReadonly)
                }
index d0081cd01014b69abf9910ffad059077d19549ee..7367dbf0adc33d47b74e34fda37d898c4e34242d 100644 (file)
@@ -48,15 +48,15 @@ func TestVerifySignatureExtraHints(t *testing.T) {
        PermissionSecret = []byte(known_key)
        defer func() { PermissionSecret = nil }()
 
-       if !VerifySignature(known_locator + "+K@xyzzy" + known_sig_hint, known_token) {
+       if !VerifySignature(known_locator+"+K@xyzzy"+known_sig_hint, known_token) {
                t.Fatal("Verify cannot handle hint before permission signature")
        }
 
-       if !VerifySignature(known_locator + known_sig_hint + "+Zfoo", known_token) {
+       if !VerifySignature(known_locator+known_sig_hint+"+Zfoo", known_token) {
                t.Fatal("Verify cannot handle hint after permission signature")
        }
 
-       if !VerifySignature(known_locator + "+K@xyzzy" + known_sig_hint + "+Zfoo", known_token) {
+       if !VerifySignature(known_locator+"+K@xyzzy"+known_sig_hint+"+Zfoo", known_token) {
                t.Fatal("Verify cannot handle hints around permission signature")
        }
 }
@@ -66,11 +66,11 @@ func TestVerifySignatureWrongSize(t *testing.T) {
        PermissionSecret = []byte(known_key)
        defer func() { PermissionSecret = nil }()
 
-       if !VerifySignature(known_hash + "+999999" + known_sig_hint, known_token) {
+       if !VerifySignature(known_hash+"+999999"+known_sig_hint, known_token) {
                t.Fatal("Verify cannot handle incorrect size hint")
        }
 
-       if !VerifySignature(known_hash + known_sig_hint, known_token) {
+       if !VerifySignature(known_hash+known_sig_hint, known_token) {
                t.Fatal("Verify cannot handle missing size hint")
        }
 }
index a11756b5f79e5c451563e92021c2cd9b1ecfe59c..0511b48d372fc3cc33b5513411512f624f12a199 100644 (file)
@@ -15,8 +15,8 @@ type TrashWorkerTestData struct {
        Block2      []byte
        BlockMtime2 int64
 
-       CreateData       bool
-       CreateInVolume1  bool
+       CreateData      bool
+       CreateInVolume1 bool
 
        UseTrashLifeTime bool
        DifferentMtimes  bool
@@ -202,7 +202,7 @@ func performTrashWorkerTest(testData TrashWorkerTestData, t *testing.T) {
                }
        }
 
-       oldBlockTime := time.Now().Add(-blob_signature_ttl-time.Minute)
+       oldBlockTime := time.Now().Add(-blob_signature_ttl - time.Minute)
 
        // Create TrashRequest for the test
        trashRequest := TrashRequest{
index 0f9fcffe52327435540df00692d0c587dd2981b6..f581b28fbf897f31badee2f2c4e4100392c5457e 100644 (file)
@@ -69,7 +69,7 @@ func (vm *RRVolumeManager) NextWritable() Volume {
                return nil
        }
        i := atomic.AddUint32(&vm.counter, 1)
-       return vm.writables[i % uint32(len(vm.writables))]
+       return vm.writables[i%uint32(len(vm.writables))]
 }
 
 func (vm *RRVolumeManager) Close() {
index 3d6b95fd8be8c9a2e497cd1c729b46a7a1be19bf..379c8903a56a02b2499c2b08cd6c2b800d9a4860 100644 (file)
@@ -14,15 +14,15 @@ type MockVolume struct {
        Store      map[string][]byte
        Timestamps map[string]time.Time
        // Bad volumes return an error for every operation.
-       Bad        bool
+       Bad bool
        // Touchable volumes' Touch() method succeeds for a locator
        // that has been Put().
-       Touchable  bool
+       Touchable bool
        // Readonly volumes return an error for Put, Delete, and
        // Touch.
-       Readonly   bool
-       called     map[string]int
-       mutex      sync.Mutex
+       Readonly bool
+       called   map[string]int
+       mutex    sync.Mutex
 }
 
 // CreateMockVolume returns a non-Bad, non-Readonly, Touchable mock
index f82598849c8ad5d9e63fb703bf479c1bbcfa888d..3b7c9930f780cf0b735016bbaac0b7c243a6d780 100644 (file)
@@ -70,12 +70,12 @@ func (v *UnixVolume) IOHandler() {
 
 func MakeUnixVolume(root string, serialize bool, readonly bool) *UnixVolume {
        v := &UnixVolume{
-               root: root,
-               queue: nil,
+               root:     root,
+               queue:    nil,
                readonly: readonly,
        }
        if serialize {
-               v.queue =make(chan *IORequest)
+               v.queue = make(chan *IORequest)
                go v.IOHandler()
        }
        return v