读取独立配置合并入总配置中
()
| 108 | |
| 109 | // 读取独立配置合并入总配置中 |
| 110 | func (opt *Plugin) assign() { |
| 111 | f, err := os.Open(opt.settingPath()) |
| 112 | defer f.Close() |
| 113 | if err == nil { |
| 114 | var modifyConfig map[string]any |
| 115 | err = yaml.NewDecoder(f).Decode(&modifyConfig) |
| 116 | if err != nil { |
| 117 | panic(err) |
| 118 | } |
| 119 | opt.RawConfig.ParseModifyFile(modifyConfig) |
| 120 | } |
| 121 | opt.registerHandler() |
| 122 | if opt != Engine { |
| 123 | opt.run() |
| 124 | } |
| 125 | } |
| 126 | |
| 127 | func (opt *Plugin) run() { |
| 128 | opt.Context, opt.CancelFunc = context.WithCancel(Engine) |
no test coverage detected