fix some typos

This commit is contained in:
徐胖 2019-04-16 10:08:21 +08:00
parent acc6c8282b
commit d924425890
3 changed files with 13 additions and 13 deletions

View file

@ -29,7 +29,7 @@ type CCProject struct {
WebURL string `xml:"webUrl,attr"` 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 { func New(r *core.Repository, b *core.Build, link string) *CCProjects {
proj := &CCProject{ proj := &CCProject{
Name: r.Slug, Name: r.Slug,

View file

@ -122,7 +122,7 @@ func (s *Client) Before(ctx context.Context, step *core.Step) error {
if err != nil { if err != nil {
return err 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 // updated when the step is created. Copy the updated
// values back to the original step object. // values back to the original step object.
step.ID = out.ID step.ID = out.ID
@ -138,7 +138,7 @@ func (s *Client) After(ctx context.Context, step *core.Step) error {
if err != nil { if err != nil {
return err 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 // when the step is created. Copy the updated values
// back to the original step object. // back to the original step object.
step.Version = out.Version step.Version = out.Version
@ -173,7 +173,7 @@ func (s *Client) AfterAll(ctx context.Context, stage *core.Stage) error {
if err != nil { if err != nil {
return err 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 // are updated when the step is created. Copy the updated
// values back to the original step object. // values back to the original step object.
stage.Version = out.Version 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 // 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 // be attempting to update the same record. Convert this error
// code to a proper error. // code to a proper error.
if res.StatusCode == 409 { if res.StatusCode == 409 {

View file

@ -342,7 +342,7 @@ func TestAfterAll(t *testing.T) {
} }
} }
func TestBefore_OptomisticLock(t *testing.T) { func TestBefore_OptimisticLock(t *testing.T) {
defer gock.Off() defer gock.Off()
gock.New("http://drone.company.com"). gock.New("http://drone.company.com").
@ -353,14 +353,14 @@ func TestBefore_OptomisticLock(t *testing.T) {
gock.InterceptClient(client.client.HTTPClient) gock.InterceptClient(client.client.HTTPClient)
err := client.Before(noContext, new(core.Step)) err := client.Before(noContext, new(core.Step))
if err != db.ErrOptimisticLock { if err != db.ErrOptimisticLock {
t.Errorf("Want optomistic lock error") t.Errorf("Want optimistic lock error")
} }
if gock.IsPending() { if gock.IsPending() {
t.Errorf("Unfinished requests") t.Errorf("Unfinished requests")
} }
} }
func TestAfter_OptomisticLock(t *testing.T) { func TestAfter_OptimisticLock(t *testing.T) {
defer gock.Off() defer gock.Off()
gock.New("http://drone.company.com"). gock.New("http://drone.company.com").
@ -371,14 +371,14 @@ func TestAfter_OptomisticLock(t *testing.T) {
gock.InterceptClient(client.client.HTTPClient) gock.InterceptClient(client.client.HTTPClient)
err := client.After(noContext, new(core.Step)) err := client.After(noContext, new(core.Step))
if err != db.ErrOptimisticLock { if err != db.ErrOptimisticLock {
t.Errorf("Want optomistic lock error") t.Errorf("Want optimistic lock error")
} }
if gock.IsPending() { if gock.IsPending() {
t.Errorf("Unfinished requests") t.Errorf("Unfinished requests")
} }
} }
func TestBeforeAll_OptomisticLock(t *testing.T) { func TestBeforeAll_OptimisticLock(t *testing.T) {
defer gock.Off() defer gock.Off()
gock.New("http://drone.company.com"). gock.New("http://drone.company.com").
@ -389,14 +389,14 @@ func TestBeforeAll_OptomisticLock(t *testing.T) {
gock.InterceptClient(client.client.HTTPClient) gock.InterceptClient(client.client.HTTPClient)
err := client.BeforeAll(noContext, new(core.Stage)) err := client.BeforeAll(noContext, new(core.Stage))
if err != db.ErrOptimisticLock { if err != db.ErrOptimisticLock {
t.Errorf("Want optomistic lock error") t.Errorf("Want optimistic lock error")
} }
if gock.IsPending() { if gock.IsPending() {
t.Errorf("Unfinished requests") t.Errorf("Unfinished requests")
} }
} }
func TestAfterAll_OptomisticLock(t *testing.T) { func TestAfterAll_OptimisticLock(t *testing.T) {
defer gock.Off() defer gock.Off()
gock.New("http://drone.company.com"). gock.New("http://drone.company.com").
@ -407,7 +407,7 @@ func TestAfterAll_OptomisticLock(t *testing.T) {
gock.InterceptClient(client.client.HTTPClient) gock.InterceptClient(client.client.HTTPClient)
err := client.AfterAll(noContext, new(core.Stage)) err := client.AfterAll(noContext, new(core.Stage))
if err != db.ErrOptimisticLock { if err != db.ErrOptimisticLock {
t.Errorf("Want optomistic lock error") t.Errorf("Want optimistic lock error")
} }
if gock.IsPending() { if gock.IsPending() {
t.Errorf("Unfinished requests") t.Errorf("Unfinished requests")