mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-07-15 01:04:38 +02:00
style: Fix staticcheck (static analysis) errors for this library (#283)
* style: Fix staticcheck errors for "error strings should not be capitalized (ST1005)" staticcheck is a static analysis tool for go. It reports several "error strings should not be capitalized (ST1005)" messages. Here, we fix it to be more compliant with the go coding styleguide. Related: #280 * style: Fix staticcheck errors for "printf-style function with dynamic format ... (SA1006)" staticcheck is a static analysis tool for go. It reports several "printf-style function with dynamic format string and no further arguments should use print-style function instead (SA1006)" messages. Here, we fix it to be more compliant with the go coding styleguide. Related: #280 * style: Fix staticcheck errors for "type X is unused (U1000)" staticcheck is a static analysis tool for go. It reports several "type X is unused (U1000)" messages. Here, we fix it to be more compliant with the go coding styleguide. Related: #280 * style: Fix staticcheck errors for "should use X instead (S1003 & SA6005)" staticcheck is a static analysis tool for go. It reports several - should use !bytes.Contains(b, []byte(`"password":"bar"`)) instead (S1003) - should use strings.EqualFold instead (SA6005) messages. Here, we fix it to be more compliant with the go coding styleguide. Related: #280 * style: Fix staticcheck errors for "unnecessary use of fmt.Sprintf (S1039)" staticcheck is a static analysis tool for go. It report several "unnecessary use of fmt.Sprintf (S1039)" messages. Here, we fix it to be more compliant with the go coding styleguide. Related: #280 * style: Fix staticcheck errors for "this value of X is never used (SA4006)" staticcheck is a static analysis tool for go. It report several "this value of X is never used (SA4006)" messages. Here, we fix it to be more compliant with the go coding styleguide. Related: #280 * style: Fix staticcheck errors for "redundant return statement (S1023)" staticcheck is a static analysis tool for go. It report several "redundant return statement (S1023)" messages. Here, we fix it to be more compliant with the go coding styleguide. Related: #280 * style: Fix staticcheck errors for "possible nil pointer dereference (SA5011)" staticcheck is a static analysis tool for go. It report several file.go:Line:character: possible nil pointer dereference (SA5011) file.go:Line:character: this check suggests that the pointer can be nil messages. Here, we fix it to be more compliant with the go coding styleguide. Related: #280 * style: Fix staticcheck errors for "this value of X is never used (SA4006)" staticcheck is a static analysis tool for go. It report several "this value of X is never used (SA4006)" messages. Here, we fix it to be more compliant with the go coding styleguide. Related: #280
This commit is contained in:
10
metaissue.go
10
metaissue.go
@ -101,7 +101,7 @@ func (s *IssueService) GetEditMeta(issue *Issue) (*EditMetaInfo, *Response, erro
|
||||
// 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) {
|
||||
if strings.EqualFold(m.Name, name) {
|
||||
return m
|
||||
}
|
||||
}
|
||||
@ -112,7 +112,7 @@ func (m *CreateMetaInfo) GetProjectWithName(name string) *MetaProject {
|
||||
// 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) {
|
||||
if strings.EqualFold(m.Key, key) {
|
||||
return m
|
||||
}
|
||||
}
|
||||
@ -123,7 +123,7 @@ func (m *CreateMetaInfo) GetProjectWithKey(key string) *MetaProject {
|
||||
// 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) {
|
||||
if strings.EqualFold(m.Name, name) {
|
||||
return m
|
||||
}
|
||||
}
|
||||
@ -199,7 +199,7 @@ func (t *MetaIssueType) CheckCompleteAndAvailable(config map[string]string) (boo
|
||||
for name := range mandatory {
|
||||
requiredFields = append(requiredFields, name)
|
||||
}
|
||||
return false, fmt.Errorf("Required field not found in provided jira.fields. Required are: %#v", requiredFields)
|
||||
return false, fmt.Errorf("required field not found in provided jira.fields. Required are: %#v", requiredFields)
|
||||
}
|
||||
}
|
||||
|
||||
@ -210,7 +210,7 @@ func (t *MetaIssueType) CheckCompleteAndAvailable(config map[string]string) (boo
|
||||
for name := range all {
|
||||
availableFields = append(availableFields, name)
|
||||
}
|
||||
return false, fmt.Errorf("Fields in jira.fields are not available in jira. Available are: %#v", availableFields)
|
||||
return false, fmt.Errorf("fields in jira.fields are not available in jira. Available are: %#v", availableFields)
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user