summaryrefslogtreecommitdiff
path: root/patchset.Get.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-15 12:15:10 -0600
committerJeff Carr <[email protected]>2025-02-15 12:21:36 -0600
commitb7b18626d87dd42d5e5fe4fac8ff66eeb9836ee9 (patch)
treebfc32effd3e69f97b3c7b2ca52131cd930bdc287 /patchset.Get.go
parent7900b1416e94feeadf133232e33f2938b672702f (diff)
more on Machine.Init()
Diffstat (limited to 'patchset.Get.go')
-rw-r--r--patchset.Get.go45
1 files changed, 0 insertions, 45 deletions
diff --git a/patchset.Get.go b/patchset.Get.go
index 963618c..fcd59eb 100644
--- a/patchset.Get.go
+++ b/patchset.Get.go
@@ -3,12 +3,6 @@
package forgepb
import (
- "bytes"
- "io/ioutil"
- "net/http"
- "os"
- "os/user"
-
"go.wit.com/log"
)
@@ -38,42 +32,3 @@ func (f *Forge) GetPatchesets() (*Patchsets, error) {
*/
return psets, nil
}
-
-func (f *Forge) HttpPost(url string, data []byte) ([]byte, error) {
- var err error
- var req *http.Request
-
- // data := []byte("some junk")
- // url := "https://go.wit.com/register/"
-
- req, err = http.NewRequest(http.MethodPost, url, bytes.NewBuffer(data))
- log.Info("httpPost() with len", len(data), "url", url)
-
- usr, _ := user.Current()
- req.Header.Set("author", usr.Username)
- hostname, _ := os.Hostname()
- req.Header.Set("hostname", hostname)
-
- client := &http.Client{}
- resp, err := client.Do(req)
- if err != nil {
- log.Error(err)
- return []byte("client.Do(req) error"), err
- }
- defer resp.Body.Close()
- log.Info("httpPost() with len", len(data))
-
- body, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- log.Error(err)
- return body, err
- }
-
- // test := strings.TrimSpace(string(body))
- // log.Info("go.wit.com returned body:", test)
- // if test == "OK" {
- // return body, nil
- // }
-
- return body, nil
-}