diff options
| author | Jeff Carr <[email protected]> | 2025-09-07 20:34:39 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-07 21:41:27 -0500 |
| commit | 16b0cad8364938950b8d2d2141e2c0a923c8fd48 (patch) | |
| tree | dede1318ef814023acc910e9b936171bf9ee9352 /patchset.http.go | |
| parent | ecf404994754b339e6e3fce1fceda7f0e0734d7c (diff) | |
this is working out so far
Diffstat (limited to 'patchset.http.go')
| -rw-r--r-- | patchset.http.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/patchset.http.go b/patchset.http.go index 5e33a6f..35330aa 100644 --- a/patchset.http.go +++ b/patchset.http.go @@ -109,6 +109,22 @@ func (p *Patches) SendReply(w http.ResponseWriter, reqPB *httppb.HttpRequest) er return err } +func (p *Patchsets) SendReply(w http.ResponseWriter, reqPB *httppb.HttpRequest) error { + data, err := p.Marshal() + if err != nil { + reqPB.Errors = append(reqPB.Errors, log.Sprintf("%v", err)) + } + if len(data) == 0 { + reqPB.Errors = append(reqPB.Errors, "Patchsets PB data was nil/emtpy without Marsha() error") + return nil + } + i, err := w.Write(data) + if err != nil { + reqPB.Errors = append(reqPB.Errors, log.Sprintf("i=%d %v", i, err)) + } + return err +} + func (p *Patchsets) HttpPostVerbose(baseURL string, route string) (*Patchsets, error) { p.PrintTable() return p.HttpPost(baseURL, route) |
