(path string, args []string)
| 225 | } |
| 226 | |
| 227 | func loadFilterPlugin(path string, args []string) (filters.Spec, error) { |
| 228 | mod, err := plugin.Open(path) |
| 229 | if err != nil { |
| 230 | return nil, fmt.Errorf("open filter plugin %s: %s", path, err) |
| 231 | } |
| 232 | |
| 233 | conf, err := readPluginConfig(path) |
| 234 | if err != nil { |
| 235 | return nil, fmt.Errorf("failed to read config for %s: %s", path, err) |
| 236 | } |
| 237 | |
| 238 | sym, err := mod.Lookup("InitFilter") |
| 239 | if err != nil { |
| 240 | return nil, fmt.Errorf("lookup module symbol failed for %s: %s", path, err) |
| 241 | } |
| 242 | return initFilterPlugin(sym, path, append(conf, args...)) |
| 243 | } |
| 244 | |
| 245 | func initFilterPlugin(sym plugin.Symbol, path string, args []string) (filters.Spec, error) { |
| 246 | fn, ok := sym.(func([]string) (filters.Spec, error)) |
no test coverage detected
searching dependent graphs…