GetDocFile gets the singular documentation File for the Module, if it exists. When creating a Module from a Bucket, we check the file paths buf.md, README.md, and README.markdown to exist, in that order. The first one to exist is chosen as the documentation File that is considered part of the Modul
(ctx context.Context, moduleReadBucket ModuleReadBucket)
| 212 | // |
| 213 | // Returns an error with fs.ErrNotExist if no documentation file exists. |
| 214 | func GetDocFile(ctx context.Context, moduleReadBucket ModuleReadBucket) (File, error) { |
| 215 | if docFilePath := getDocFilePathForModuleReadBucket(ctx, moduleReadBucket); docFilePath != "" { |
| 216 | return moduleReadBucket.GetFile(ctx, docFilePath) |
| 217 | } |
| 218 | return nil, fs.ErrNotExist |
| 219 | } |
| 220 | |
| 221 | // GetLicenseFile gets the license File for the Module, if it exists. |
| 222 | // |
no test coverage detected
searching dependent graphs…