(ctx context.Context, runtime *common.RuntimeContext, fileToken, version string)
| 167 | } |
| 168 | |
| 169 | func downloadMarkdownContent(ctx context.Context, runtime *common.RuntimeContext, fileToken, version string) (string, string, error) { |
| 170 | resp, fileName, err := openMarkdownDownloadVersion(ctx, runtime, fileToken, version) |
| 171 | if err != nil { |
| 172 | return "", "", err |
| 173 | } |
| 174 | defer resp.Body.Close() |
| 175 | |
| 176 | payload, err := readMarkdownDiffPayload(resp.Body, "remote Markdown content") |
| 177 | if err != nil { |
| 178 | return "", "", wrapMarkdownDownloadError(err) |
| 179 | } |
| 180 | return fileName, string(payload), nil |
| 181 | } |
| 182 | |
| 183 | func readMarkdownLocalFile(runtime *common.RuntimeContext, filePath string) (string, error) { |
| 184 | f, err := runtime.FileIO().Open(filePath) |
no test coverage detected