Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
Merge pull request #8 from kishikawa12/main
Browse files Browse the repository at this point in the history
Minor fixes to utility script and auto tag JSON
  • Loading branch information
Dynatrace-Asad-Ali authored Sep 2, 2021
2 parents 5e78deb + 14f55e7 commit adbce99
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion assets/04-AutoTags/BackgroundMethodServerTag.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
}
]
}
],
]
}
2 changes: 1 addition & 1 deletion assets/04-AutoTags/DirectoryServerTag.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@
}
]
}
],
]
}
17 changes: 8 additions & 9 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ func (p *Processor) Process() error {
if data, err = p.Vars.Load(rootDir.Join(dir, file)); err != nil {
return err
}
var id string
if id, err = p.post(endpointName, endpointURL, data); err != nil {
// var id string
if err = p.post(endpointName, endpointURL, data); err != nil {
return err
}

Expand All @@ -144,27 +144,26 @@ func (p *Processor) Process() error {
// return err
// }
// }

}
}
return nil
}

func (p *Processor) post(endpointName string, endpointURL string, data []byte) (string, error) {
func (p *Processor) post(endpointName string, endpointURL string, data []byte) (error) {
var err error
var req *http.Request
if req, err = p.setupHTTPRequest("POST", endpointURL, data); err != nil {
return "", err
return err
}
var resp *http.Response
if resp, err = p.Client.Do(req); err != nil {
return "", err
return err
}
defer resp.Body.Close()

var id string
id, _, err = p.processResponse(resp, endpointName)
return id, err
// var id string
_, _, err = p.processResponse(resp, endpointName)
return err
}

func (p *Processor) setupHTTPRequest(method string, endpointURL string, data []byte) (*http.Request, error) {
Expand Down

0 comments on commit adbce99

Please sign in to comment.