MCPcopy
hub / github.com/larksuite/cli / saveAndPrint

Function saveAndPrint

internal/client/response.go:167–174  ·  view source on GitHub ↗
(fio fileio.FileIO, resp *larkcore.ApiResp, path string, w io.Writer)

Source from the content-addressed store, hash-verified

165}
166
167func saveAndPrint(fio fileio.FileIO, resp *larkcore.ApiResp, path string, w io.Writer) error {
168 meta, err := SaveResponse(fio, resp, path)
169 if err != nil {
170 return classifySaveErr(err)
171 }
172 output.PrintJson(w, meta)
173 return nil
174}
175
176// classifySaveErr routes a SaveResponse error to the right typed shape.
177// Path-validation failures are caller-induced (an unsafe --output path),

Callers 1

HandleResponseFunction · 0.85

Calls 3

PrintJsonFunction · 0.92
SaveResponseFunction · 0.85
classifySaveErrFunction · 0.85

Tested by

no test coverage detected