From d9244258907e1bbdb01b422213fe1c193658ba09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BE=90=E8=83=96?= Date: Tue, 16 Apr 2019 10:08:21 +0800 Subject: [PATCH] fix some typos --- handler/api/ccmenu/cc.go | 2 +- operator/manager/rpc/client.go | 8 ++++---- operator/manager/rpc/client_test.go | 16 ++++++++-------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/handler/api/ccmenu/cc.go b/handler/api/ccmenu/cc.go index cf4da566..d55fdd03 100644 --- a/handler/api/ccmenu/cc.go +++ b/handler/api/ccmenu/cc.go @@ -29,7 +29,7 @@ type CCProject struct { WebURL string `xml:"webUrl,attr"` } -// New creates a new CCPojrect from the Repository and Build details. +// New creates a new CCProject from the Repository and Build details. func New(r *core.Repository, b *core.Build, link string) *CCProjects { proj := &CCProject{ Name: r.Slug, diff --git a/operator/manager/rpc/client.go b/operator/manager/rpc/client.go index ef256938..b5bf4ce1 100644 --- a/operator/manager/rpc/client.go +++ b/operator/manager/rpc/client.go @@ -122,7 +122,7 @@ func (s *Client) Before(ctx context.Context, step *core.Step) error { if err != nil { return err } - // the step ID and version (optomistic locking) are + // the step ID and version (optimistic locking) are // updated when the step is created. Copy the updated // values back to the original step object. step.ID = out.ID @@ -138,7 +138,7 @@ func (s *Client) After(ctx context.Context, step *core.Step) error { if err != nil { return err } - // the step version (optomistic locking) is updated + // the step version (optimistic locking) is updated // when the step is created. Copy the updated values // back to the original step object. step.Version = out.Version @@ -173,7 +173,7 @@ func (s *Client) AfterAll(ctx context.Context, stage *core.Stage) error { if err != nil { return err } - // the stage timestamps and version (optomistic locking) + // the stage timestamps and version (optimistic locking) // are updated when the step is created. Copy the updated // values back to the original step object. stage.Version = out.Version @@ -237,7 +237,7 @@ func (s *Client) send(ctx context.Context, path string, in, out interface{}) err } // Check the response for a 409 conflict. This indicates an - // optimtistic lock error, in which case multiple clients may + // optimistic lock error, in which case multiple clients may // be attempting to update the same record. Convert this error // code to a proper error. if res.StatusCode == 409 { diff --git a/operator/manager/rpc/client_test.go b/operator/manager/rpc/client_test.go index 9fcbd40f..da73ca20 100644 --- a/operator/manager/rpc/client_test.go +++ b/operator/manager/rpc/client_test.go @@ -342,7 +342,7 @@ func TestAfterAll(t *testing.T) { } } -func TestBefore_OptomisticLock(t *testing.T) { +func TestBefore_OptimisticLock(t *testing.T) { defer gock.Off() gock.New("http://drone.company.com"). @@ -353,14 +353,14 @@ func TestBefore_OptomisticLock(t *testing.T) { gock.InterceptClient(client.client.HTTPClient) err := client.Before(noContext, new(core.Step)) if err != db.ErrOptimisticLock { - t.Errorf("Want optomistic lock error") + t.Errorf("Want optimistic lock error") } if gock.IsPending() { t.Errorf("Unfinished requests") } } -func TestAfter_OptomisticLock(t *testing.T) { +func TestAfter_OptimisticLock(t *testing.T) { defer gock.Off() gock.New("http://drone.company.com"). @@ -371,14 +371,14 @@ func TestAfter_OptomisticLock(t *testing.T) { gock.InterceptClient(client.client.HTTPClient) err := client.After(noContext, new(core.Step)) if err != db.ErrOptimisticLock { - t.Errorf("Want optomistic lock error") + t.Errorf("Want optimistic lock error") } if gock.IsPending() { t.Errorf("Unfinished requests") } } -func TestBeforeAll_OptomisticLock(t *testing.T) { +func TestBeforeAll_OptimisticLock(t *testing.T) { defer gock.Off() gock.New("http://drone.company.com"). @@ -389,14 +389,14 @@ func TestBeforeAll_OptomisticLock(t *testing.T) { gock.InterceptClient(client.client.HTTPClient) err := client.BeforeAll(noContext, new(core.Stage)) if err != db.ErrOptimisticLock { - t.Errorf("Want optomistic lock error") + t.Errorf("Want optimistic lock error") } if gock.IsPending() { t.Errorf("Unfinished requests") } } -func TestAfterAll_OptomisticLock(t *testing.T) { +func TestAfterAll_OptimisticLock(t *testing.T) { defer gock.Off() gock.New("http://drone.company.com"). @@ -407,7 +407,7 @@ func TestAfterAll_OptomisticLock(t *testing.T) { gock.InterceptClient(client.client.HTTPClient) err := client.AfterAll(noContext, new(core.Stage)) if err != db.ErrOptimisticLock { - t.Errorf("Want optomistic lock error") + t.Errorf("Want optimistic lock error") } if gock.IsPending() { t.Errorf("Unfinished requests")