diff options
| author | Jeff Carr <[email protected]> | 2025-01-28 13:20:10 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-28 13:20:10 -0600 |
| commit | 91c28de514b1a41e2355714f5352f5438dbe34a2 (patch) | |
| tree | fbf0c71cecc509195501be13a26dd07c0d026706 /send.go | |
| parent | 3b6e84abdfdff7181c1eb9553a6c6589d6ba027a (diff) | |
make a patchset grid widget
Diffstat (limited to 'send.go')
| -rw-r--r-- | send.go | 30 |
1 files changed, 17 insertions, 13 deletions
@@ -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 { |
