mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-04-21 12:07:01 +02:00
Minor fix to comply with go vet
This commit is contained in:
parent
233f266cfb
commit
5857a2e350
2
jira.go
2
jira.go
@ -76,7 +76,7 @@ func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Requ
|
|||||||
var buf io.ReadWriter
|
var buf io.ReadWriter
|
||||||
if body != nil {
|
if body != nil {
|
||||||
buf = new(bytes.Buffer)
|
buf = new(bytes.Buffer)
|
||||||
err := json.NewEncoder(buf).Encode(body)
|
err = json.NewEncoder(buf).Encode(body)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
10
metaissue.go
10
metaissue.go
@ -7,7 +7,7 @@ import (
|
|||||||
"github.com/trivago/tgo/tcontainer"
|
"github.com/trivago/tgo/tcontainer"
|
||||||
)
|
)
|
||||||
|
|
||||||
// CreateMeta contains information about fields and their attributed to create a ticket.
|
// CreateMetaInfo contains information about fields and their attributed to create a ticket.
|
||||||
type CreateMetaInfo struct {
|
type CreateMetaInfo struct {
|
||||||
Expand string `json:"expand,omitempty"`
|
Expand string `json:"expand,omitempty"`
|
||||||
Projects []*MetaProject `json:"projects,omitempty"`
|
Projects []*MetaProject `json:"projects,omitempty"`
|
||||||
@ -72,7 +72,7 @@ func (m *CreateMetaInfo) GetProjectWithName(name string) *MetaProject {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetProjectWithName returns a project with "name" from the meta information recieved. If not found, this returns nil.
|
// GetProjectWithKey returns a project with "name" from the meta information recieved. If not found, this returns nil.
|
||||||
// The comparision of the name is case insensitive.
|
// The comparision of the name is case insensitive.
|
||||||
func (m *CreateMetaInfo) GetProjectWithKey(key string) *MetaProject {
|
func (m *CreateMetaInfo) GetProjectWithKey(key string) *MetaProject {
|
||||||
for _, m := range m.Projects {
|
for _, m := range m.Projects {
|
||||||
@ -83,7 +83,7 @@ func (m *CreateMetaInfo) GetProjectWithKey(key string) *MetaProject {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetIssueWithName returns an IssueType with name from a given MetaProject. If not found, this returns nil.
|
// 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 comparision of the name is case insensitive
|
||||||
func (p *MetaProject) GetIssueTypeWithName(name string) *MetaIssueType {
|
func (p *MetaProject) GetIssueTypeWithName(name string) *MetaIssueType {
|
||||||
for _, m := range p.IssueTypes {
|
for _, m := range p.IssueTypes {
|
||||||
@ -113,7 +113,7 @@ func (p *MetaProject) GetIssueTypeWithName(name string) *MetaIssueType {
|
|||||||
// This choice has been made so that the it is easier to generate the create api request later.
|
// This choice has been made so that the it is easier to generate the create api request later.
|
||||||
func (t *MetaIssueType) GetMandatoryFields() (map[string]string, error) {
|
func (t *MetaIssueType) GetMandatoryFields() (map[string]string, error) {
|
||||||
ret := make(map[string]string)
|
ret := make(map[string]string)
|
||||||
for key, _ := range t.Fields {
|
for key := range t.Fields {
|
||||||
required, err := t.Fields.Bool(key + "/required")
|
required, err := t.Fields.Bool(key + "/required")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -133,7 +133,7 @@ func (t *MetaIssueType) GetMandatoryFields() (map[string]string, error) {
|
|||||||
// The key of the returned map is what you see in the form and the value is how it is representated in the jira schema.
|
// The key of the returned map is what you see in the form and the value is how it is representated in the jira schema.
|
||||||
func (t *MetaIssueType) GetAllFields() (map[string]string, error) {
|
func (t *MetaIssueType) GetAllFields() (map[string]string, error) {
|
||||||
ret := make(map[string]string)
|
ret := make(map[string]string)
|
||||||
for key, _ := range t.Fields {
|
for key := range t.Fields {
|
||||||
|
|
||||||
name, err := t.Fields.String(key + "/name")
|
name, err := t.Fields.String(key + "/name")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -570,7 +570,7 @@ func TestMetaIssueType_CheckCompleteAndAvailable_Success(t *testing.T) {
|
|||||||
|
|
||||||
ok, err := m.CheckCompleteAndAvailable(config)
|
ok, err := m.CheckCompleteAndAvailable(config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error("Expected nil error. Recieved %s", err)
|
t.Errorf("Expected nil error. Recieved %s", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if ok != true {
|
if ok != true {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user