From 880a13c107d0b33257a328aff4437115b11f0fba Mon Sep 17 00:00:00 2001 From: Andy Grunwald Date: Mon, 1 May 2017 15:03:03 +0200 Subject: [PATCH] Fixed typos --- authentication.go | 2 +- issue.go | 6 +++--- issue_test.go | 2 +- jira_test.go | 40 ++++++++++++++++++++-------------------- metaissue.go | 6 +++--- metaissue_test.go | 2 +- 6 files changed, 29 insertions(+), 29 deletions(-) diff --git a/authentication.go b/authentication.go index aefa10b..e3cf6fc 100644 --- a/authentication.go +++ b/authentication.go @@ -130,7 +130,7 @@ func (s *AuthenticationService) Logout() error { return fmt.Errorf("The logout was unsuccessful with status %d", resp.StatusCode) } - // If logout successfull, delete session + // If logout successful, delete session s.client.session = nil return nil diff --git a/issue.go b/issue.go index dcf50bc..6c5edd7 100644 --- a/issue.go +++ b/issue.go @@ -137,7 +137,7 @@ func (i *IssueFields) MarshalJSON() ([]byte, error) { m := structs.Map(i) unknowns, okay := m["Unknowns"] if okay { - // if unknowns present, shift all key value from unkown to a level up + // if unknowns present, shift all key value from unknown to a level up for key, value := range unknowns.(tcontainer.MarshalMap) { m[key] = value } @@ -297,7 +297,7 @@ type Transition struct { Fields map[string]TransitionField `json:"fields" structs:"fields"` } -// TransitionField represents the value of one Transistion +// TransitionField represents the value of one Transition type TransitionField struct { Required bool `json:"required" structs:"required"` } @@ -307,7 +307,7 @@ type CreateTransitionPayload struct { Transition TransitionPayload `json:"transition" structs:"transition"` } -// TransitionPayload represents the request payload of Transistion calls like DoTransition +// TransitionPayload represents the request payload of Transition calls like DoTransition type TransitionPayload struct { ID string `json:"id" structs:"id"` } diff --git a/issue_test.go b/issue_test.go index 48d2b2f..276fbb3 100644 --- a/issue_test.go +++ b/issue_test.go @@ -651,7 +651,7 @@ func TestIssueFields_MarshalJSON_Success(t *testing.T) { } received := new(IssueFields) - // the order of json might be different. so unmarshal it again and comapre objects + // the order of json might be different. so unmarshal it again and compare objects err = json.Unmarshal(bytes, received) if err != nil { t.Errorf("Expected nil err, received %s", err) diff --git a/jira_test.go b/jira_test.go index c421a10..b35aac1 100644 --- a/jira_test.go +++ b/jira_test.go @@ -132,7 +132,7 @@ func TestCheckResponse(t *testing.T) { func TestClient_NewRequest(t *testing.T) { c, err := NewClient(nil, testJIRAInstanceURL) if err != nil { - t.Errorf("An error occured. Expected nil. Got %+v.", err) + t.Errorf("An error occurred. Expected nil. Got %+v.", err) } inURL, outURL := "rest/api/2/issue/", testJIRAInstanceURL+"rest/api/2/issue/" @@ -154,7 +154,7 @@ func TestClient_NewRequest(t *testing.T) { func TestClient_NewRawRequest(t *testing.T) { c, err := NewClient(nil, testJIRAInstanceURL) if err != nil { - t.Errorf("An error occured. Expected nil. Got %+v.", err) + t.Errorf("An error occurred. Expected nil. Got %+v.", err) } inURL, outURL := "rest/api/2/issue/", testJIRAInstanceURL+"rest/api/2/issue/" @@ -187,7 +187,7 @@ func testURLParseError(t *testing.T, err error) { func TestClient_NewRequest_BadURL(t *testing.T) { c, err := NewClient(nil, testJIRAInstanceURL) if err != nil { - t.Errorf("An error occured. Expected nil. Got %+v.", err) + t.Errorf("An error occurred. Expected nil. Got %+v.", err) } _, err = c.NewRequest("GET", ":", nil) testURLParseError(t, err) @@ -196,7 +196,7 @@ func TestClient_NewRequest_BadURL(t *testing.T) { func TestClient_NewRequest_SessionCookies(t *testing.T) { c, err := NewClient(nil, testJIRAInstanceURL) if err != nil { - t.Errorf("An error occured. Expected nil. Got %+v.", err) + t.Errorf("An error occurred. Expected nil. Got %+v.", err) } cookie := &http.Cookie{Name: "testcookie", Value: "testvalue"} @@ -208,16 +208,16 @@ func TestClient_NewRequest_SessionCookies(t *testing.T) { req, err := c.NewRequest("GET", inURL, inBody) if err != nil { - t.Errorf("An error occured. Expected nil. Got %+v.", err) + t.Errorf("An error occurred. Expected nil. Got %+v.", err) } if len(req.Cookies()) != len(c.session.Cookies) { - t.Errorf("An error occured. Expected %d cookie(s). Got %d.", len(c.session.Cookies), len(req.Cookies())) + t.Errorf("An error occurred. Expected %d cookie(s). Got %d.", len(c.session.Cookies), len(req.Cookies())) } for i, v := range req.Cookies() { if v.String() != c.session.Cookies[i].String() { - t.Errorf("An error occured. Unexpected cookie. Expected %s, actual %s.", v.String(), c.session.Cookies[i].String()) + t.Errorf("An error occurred. Unexpected cookie. Expected %s, actual %s.", v.String(), c.session.Cookies[i].String()) } } } @@ -225,7 +225,7 @@ func TestClient_NewRequest_SessionCookies(t *testing.T) { func TestClient_NewRequest_BasicAuth(t *testing.T) { c, err := NewClient(nil, testJIRAInstanceURL) if err != nil { - t.Errorf("An error occured. Expected nil. Got %+v.", err) + t.Errorf("An error occurred. Expected nil. Got %+v.", err) } c.Authentication.SetBasicAuth("test-user", "test-password") @@ -235,12 +235,12 @@ func TestClient_NewRequest_BasicAuth(t *testing.T) { req, err := c.NewRequest("GET", inURL, inBody) if err != nil { - t.Errorf("An error occured. Expected nil. Got %+v.", err) + t.Errorf("An error occurred. Expected nil. Got %+v.", err) } username, password, ok := req.BasicAuth() if !ok || username != "test-user" || password != "test-password" { - t.Errorf("An error occured. Expected basic auth username %s and password %s. Got username %s and password %s.", "test-user", "test-password", username, password) + t.Errorf("An error occurred. Expected basic auth username %s and password %s. Got username %s and password %s.", "test-user", "test-password", username, password) } } @@ -251,7 +251,7 @@ func TestClient_NewRequest_BasicAuth(t *testing.T) { func TestClient_NewRequest_EmptyBody(t *testing.T) { c, err := NewClient(nil, testJIRAInstanceURL) if err != nil { - t.Errorf("An error occured. Expected nil. Got %+v.", err) + t.Errorf("An error occurred. Expected nil. Got %+v.", err) } req, err := c.NewRequest("GET", "/", nil) if err != nil { @@ -265,7 +265,7 @@ func TestClient_NewRequest_EmptyBody(t *testing.T) { func TestClient_NewMultiPartRequest(t *testing.T) { c, err := NewClient(nil, testJIRAInstanceURL) if err != nil { - t.Errorf("An error occured. Expected nil. Got %+v.", err) + t.Errorf("An error occurred. Expected nil. Got %+v.", err) } cookie := &http.Cookie{Name: "testcookie", Value: "testvalue"} @@ -277,28 +277,28 @@ func TestClient_NewMultiPartRequest(t *testing.T) { req, err := c.NewMultiPartRequest("GET", inURL, inBuf) if err != nil { - t.Errorf("An error occured. Expected nil. Got %+v.", err) + t.Errorf("An error occurred. Expected nil. Got %+v.", err) } if len(req.Cookies()) != len(c.session.Cookies) { - t.Errorf("An error occured. Expected %d cookie(s). Got %d.", len(c.session.Cookies), len(req.Cookies())) + t.Errorf("An error occurred. Expected %d cookie(s). Got %d.", len(c.session.Cookies), len(req.Cookies())) } for i, v := range req.Cookies() { if v.String() != c.session.Cookies[i].String() { - t.Errorf("An error occured. Unexpected cookie. Expected %s, actual %s.", v.String(), c.session.Cookies[i].String()) + t.Errorf("An error occurred. Unexpected cookie. Expected %s, actual %s.", v.String(), c.session.Cookies[i].String()) } } if req.Header.Get("X-Atlassian-Token") != "nocheck" { - t.Errorf("An error occured. Unexpected X-Atlassian-Token header value. Expected nocheck, actual %s.", req.Header.Get("X-Atlassian-Token")) + t.Errorf("An error occurred. Unexpected X-Atlassian-Token header value. Expected nocheck, actual %s.", req.Header.Get("X-Atlassian-Token")) } } func TestClient_NewMultiPartRequest_BasicAuth(t *testing.T) { c, err := NewClient(nil, testJIRAInstanceURL) if err != nil { - t.Errorf("An error occured. Expected nil. Got %+v.", err) + t.Errorf("An error occurred. Expected nil. Got %+v.", err) } c.Authentication.SetBasicAuth("test-user", "test-password") @@ -308,16 +308,16 @@ func TestClient_NewMultiPartRequest_BasicAuth(t *testing.T) { req, err := c.NewMultiPartRequest("GET", inURL, inBuf) if err != nil { - t.Errorf("An error occured. Expected nil. Got %+v.", err) + t.Errorf("An error occurred. Expected nil. Got %+v.", err) } username, password, ok := req.BasicAuth() if !ok || username != "test-user" || password != "test-password" { - t.Errorf("An error occured. Expected basic auth username %s and password %s. Got username %s and password %s.", "test-user", "test-password", username, password) + t.Errorf("An error occurred. Expected basic auth username %s and password %s. Got username %s and password %s.", "test-user", "test-password", username, password) } if req.Header.Get("X-Atlassian-Token") != "nocheck" { - t.Errorf("An error occured. Unexpected X-Atlassian-Token header value. Expected nocheck, actual %s.", req.Header.Get("X-Atlassian-Token")) + t.Errorf("An error occurred. Unexpected X-Atlassian-Token header value. Expected nocheck, actual %s.", req.Header.Get("X-Atlassian-Token")) } } diff --git a/metaissue.go b/metaissue.go index 6c69256..e922d66 100644 --- a/metaissue.go +++ b/metaissue.go @@ -62,7 +62,7 @@ func (s *IssueService) GetCreateMeta(projectkey string) (*CreateMetaInfo, *Respo } // GetProjectWithName returns a project with "name" from the meta information received. If not found, this returns nil. -// The comparision of the name is case insensitive. +// The comparison of the name is case insensitive. func (m *CreateMetaInfo) GetProjectWithName(name string) *MetaProject { for _, m := range m.Projects { if strings.ToLower(m.Name) == strings.ToLower(name) { @@ -73,7 +73,7 @@ func (m *CreateMetaInfo) GetProjectWithName(name string) *MetaProject { } // GetProjectWithKey returns a project with "name" from the meta information received. If not found, this returns nil. -// The comparision of the name is case insensitive. +// The comparison of the name is case insensitive. func (m *CreateMetaInfo) GetProjectWithKey(key string) *MetaProject { for _, m := range m.Projects { if strings.ToLower(m.Key) == strings.ToLower(key) { @@ -84,7 +84,7 @@ func (m *CreateMetaInfo) GetProjectWithKey(key string) *MetaProject { } // GetIssueTypeWithName returns an IssueType with name from a given MetaProject. If not found, this returns nil. -// The comparision of the name is case insensitive +// The comparison of the name is case insensitive func (p *MetaProject) GetIssueTypeWithName(name string) *MetaIssueType { for _, m := range p.IssueTypes { if strings.ToLower(m.Name) == strings.ToLower(name) { diff --git a/metaissue_test.go b/metaissue_test.go index 4cd0805..3d5b144 100644 --- a/metaissue_test.go +++ b/metaissue_test.go @@ -100,7 +100,7 @@ func TestIssueService_GetCreateMeta_Success(t *testing.T) { "self": "https://my.jira.com/rest/api/2/component/14152", "id": "14152", "name": "Cloud services", - "description": "AWS and similiar services" + "description": "AWS and similar services" }, { "self": "https://my.jira.com/rest/api/2/component/14147", "id": "14147",