make HttpPost() global
This commit is contained in:
parent
1191b9b65d
commit
9ec7b4394f
|
@ -17,7 +17,7 @@ var forgeURL string = "https://go.wit.com/"
|
||||||
func (f *Forge) GetPatchesets() (*Patchsets, error) {
|
func (f *Forge) GetPatchesets() (*Patchsets, error) {
|
||||||
url := forgeURL + "/GetPatchsets"
|
url := forgeURL + "/GetPatchsets"
|
||||||
log.Info("GetPatchsets() url", url)
|
log.Info("GetPatchsets() url", url)
|
||||||
body, err := httpPost(url, nil)
|
body, err := f.HttpPost(url, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Info("httpPost() failed:", err)
|
log.Info("httpPost() failed:", err)
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -39,7 +39,7 @@ func (f *Forge) GetPatchesets() (*Patchsets, error) {
|
||||||
return psets, nil
|
return psets, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func httpPost(url string, data []byte) ([]byte, error) {
|
func (f *Forge) HttpPost(url string, data []byte) ([]byte, error) {
|
||||||
var err error
|
var err error
|
||||||
var req *http.Request
|
var req *http.Request
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue