From 5e4f1e54c327adb8354203984f64b96945ed94a9 Mon Sep 17 00:00:00 2001 From: TangBin Date: Mon, 24 Dec 2018 19:25:08 +0800 Subject: [PATCH] make fmt --- pkg/compute/tasks/disk_reset_task.go | 2 +- pkg/util/aws/keypair_test.go | 6 +++--- pkg/util/aws/storagecache.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/compute/tasks/disk_reset_task.go b/pkg/compute/tasks/disk_reset_task.go index ae6f7da2b4..9c2b2cb447 100644 --- a/pkg/compute/tasks/disk_reset_task.go +++ b/pkg/compute/tasks/disk_reset_task.go @@ -87,7 +87,7 @@ func (self *DiskResetTask) OnRequestResetDisk(ctx context.Context, disk *models. snapshot := iSnapshot.(*models.SSnapshot) externalId, _ := data.GetString("exteranl_disk_id") - if disk.DiskSize != snapshot.Size || (len(externalId) > 0 && externalId != disk.GetExternalId() ){ + if disk.DiskSize != snapshot.Size || (len(externalId) > 0 && externalId != disk.GetExternalId()) { _, err := models.DiskManager.TableSpec().Update(disk, func() error { disk.DiskSize = snapshot.Size disk.ExternalId = externalId diff --git a/pkg/util/aws/keypair_test.go b/pkg/util/aws/keypair_test.go index 52477768f5..737f286cb3 100644 --- a/pkg/util/aws/keypair_test.go +++ b/pkg/util/aws/keypair_test.go @@ -3,7 +3,7 @@ package aws import "testing" type testPublicKey struct { - publickey string + publickey string fingerprint string } @@ -22,9 +22,9 @@ func TestMd5Fingerprint(t *testing.T) { continue } - if fingerprint != k.fingerprint { + if fingerprint != k.fingerprint { t.Errorf("ssh-rsa fingerprint is not as expected.%s != %s", fingerprint, k.fingerprint) continue } - } + } } diff --git a/pkg/util/aws/storagecache.go b/pkg/util/aws/storagecache.go index 3223a1d9be..be8e12b481 100644 --- a/pkg/util/aws/storagecache.go +++ b/pkg/util/aws/storagecache.go @@ -161,7 +161,7 @@ func (self *SStoragecache) uploadImage(userCred mcclient.TokenCredential, imageI return "", err } - defer s3client.DeleteBucket(&s3.DeleteBucketInput{Bucket: &bucketName}) // remove bucket + defer s3client.DeleteBucket(&s3.DeleteBucketInput{Bucket: &bucketName}) // remove bucket var diskFormat string s := auth.GetAdminSession(options.Options.Region, "") @@ -196,7 +196,7 @@ func (self *SStoragecache) uploadImage(userCred mcclient.TokenCredential, imageI if err != nil { return "", err } - defer s3client.DeleteObject(&s3.DeleteObjectInput{Bucket: &bucketName, Key: &imageId}) // remove object + defer s3client.DeleteObject(&s3.DeleteObjectInput{Bucket: &bucketName, Key: &imageId}) // remove object } else { meta, _, err := modules.Images.Download(s, imageId) if err != nil {