(fio fileio.FileIO, resp *larkcore.ApiResp, path string, w io.Writer)
| 165 | } |
| 166 | |
| 167 | func 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), |
no test coverage detected