Reads the first available file found in a plugin and uses it. This means only one plugin wins!
(name string)
| 226 | // Reads the first available file found in a plugin and uses it. |
| 227 | // This means only one plugin wins! |
| 228 | func (p pluginRegistry) ReadFile(name string) ([]byte, error) { |
| 229 | for _, p := range registry { |
| 230 | |
| 231 | if embedPath, ok := p.files.filePaths[name]; ok { |
| 232 | b, err := p.files.fileSystem.ReadFile(embedPath) |
| 233 | if err == nil { |
| 234 | return b, nil |
| 235 | } |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | return nil, fs.ErrNotExist |
| 240 | } |
| 241 | |
| 242 | func (p pluginRegistry) Open(name string) (fs.File, error) { |
| 243 |
no outgoing calls