File tree Expand file tree Collapse file tree 1 file changed +3
-21
lines changed Expand file tree Collapse file tree 1 file changed +3
-21
lines changed Original file line number Diff line number Diff line change 11package jira
22
3- import (
4- "encoding/json"
5- "fmt"
6- "io/ioutil"
7- )
8-
93// ComponentService handles components for the JIRA instance / API.
104//
115// JIRA API docs: https://docs.atlassian.com/software/jira/docs/api/REST/7.10.1/#api/2/component
@@ -32,21 +26,9 @@ func (s *ComponentService) Create(options *CreateComponentOptions) (*ProjectComp
3226 if err != nil {
3327 return nil , nil , err
3428 }
35- resp , err := s .client .Do (req , nil )
36- if err != nil {
37- // incase of error return the resp for further inspection
38- return nil , resp , err
39- }
4029
4130 component := new (ProjectComponent )
42- defer resp .Body .Close ()
43- data , err := ioutil .ReadAll (resp .Body )
44- if err != nil {
45- return nil , resp , fmt .Errorf ("Could not read the returned data" )
46- }
47- err = json .Unmarshal (data , component )
48- if err != nil {
49- return nil , resp , fmt .Errorf ("Could not unmarshall the data into struct" )
50- }
51- return component , resp , nil
31+ resp , err := s .client .Do (req , component )
32+
33+ return component , resp , err
5234}
You can’t perform that action at this time.
0 commit comments