summaryrefslogtreecommitdiff
path: root/send.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-28 13:20:10 -0600
committerJeff Carr <[email protected]>2025-01-28 13:20:10 -0600
commit91c28de514b1a41e2355714f5352f5438dbe34a2 (patch)
treefbf0c71cecc509195501be13a26dd07c0d026706 /send.go
parent3b6e84abdfdff7181c1eb9553a6c6589d6ba027a (diff)
make a patchset grid widget
Diffstat (limited to 'send.go')
-rw-r--r--send.go30
1 files changed, 17 insertions, 13 deletions
diff --git a/send.go b/send.go
index cf389ce..80073b1 100644
--- a/send.go
+++ b/send.go
@@ -35,27 +35,31 @@ func sendPatches(pset *forgepb.Patchset) error {
return nil
}
-func listPatches() error {
+func listPatches() ([]string, error) {
var url string
url = me.urlbase + "/patchsetlist"
body, err := me.forge.HttpPost(url, nil)
if err != nil {
log.Info("httpPost() failed:", err)
- return err
+ return nil, err
}
- var last string
+ /*
+ var last string
+ test := strings.TrimSpace(string(body))
+ for _, line := range strings.Split(test, "\n") {
+ log.Info("patchset:", line)
+ last = strings.TrimSpace(line)
+ }
+ parts := strings.Fields(last)
+ if len(parts) == 0 {
+ return fmt.Errorf("listPatches() there are no patchsets at this time")
+ }
+ getPatch(parts[0])
+ return nil
+ */
test := strings.TrimSpace(string(body))
- for _, line := range strings.Split(test, "\n") {
- log.Info("patchset:", line)
- last = strings.TrimSpace(line)
- }
- parts := strings.Fields(last)
- if len(parts) == 0 {
- return fmt.Errorf("listPatches() there are no patchsets at this time")
- }
- getPatch(parts[0])
- return nil
+ return strings.Split(test, "\n"), nil
}
func lastPatch() string {