Improve config readability by removing unnecessary fields and adding omitempty
This commit is contained in:
6
main.go
6
main.go
@@ -427,11 +427,7 @@ func CreateExampleConfig() {
|
||||
// Multiline regex example (DOTALL is auto-enabled). Captures numeric in nested XML.
|
||||
{
|
||||
Name: "XMLNestedValueMultiply",
|
||||
Regex: `
|
||||
<item>\s*
|
||||
\s*<name>!any</name>\s*
|
||||
\s*<value>(!num)</value>\s*
|
||||
</item>`,
|
||||
Regex: `<item>\s*\s*<name>!any<\/name>\s*\s*<value>(!num)<\/value>\s*\s*<\/item>`,
|
||||
Lua: `* $multiply`,
|
||||
Files: []string{"data/**/*.xml"},
|
||||
// Demonstrates multiline regex in YAML
|
||||
|
@@ -15,17 +15,17 @@ import (
|
||||
var modifyCommandLogger = logger.Default.WithPrefix("utils/modifycommand")
|
||||
|
||||
type ModifyCommand struct {
|
||||
Name string `yaml:"name"`
|
||||
Regex string `yaml:"regex"`
|
||||
Regexes []string `yaml:"regexes"`
|
||||
Lua string `yaml:"lua"`
|
||||
Files []string `yaml:"files"`
|
||||
Reset bool `yaml:"reset"`
|
||||
LogLevel string `yaml:"loglevel"`
|
||||
Isolate bool `yaml:"isolate"`
|
||||
NoDedup bool `yaml:"nodedup"`
|
||||
Disabled bool `yaml:"disable"`
|
||||
Modifiers map[string]interface{} `yaml:"modifiers"`
|
||||
Name string `yaml:"name,omitempty"`
|
||||
Regex string `yaml:"regex,omitempty"`
|
||||
Regexes []string `yaml:"regexes,omitempty"`
|
||||
Lua string `yaml:"lua,omitempty"`
|
||||
Files []string `yaml:"files,omitempty"`
|
||||
Reset bool `yaml:"reset,omitempty"`
|
||||
LogLevel string `yaml:"loglevel,omitempty"`
|
||||
Isolate bool `yaml:"isolate,omitempty"`
|
||||
NoDedup bool `yaml:"nodedup,omitempty"`
|
||||
Disabled bool `yaml:"disable,omitempty"`
|
||||
Modifiers map[string]interface{} `yaml:"modifiers,omitempty"`
|
||||
}
|
||||
|
||||
type CookFile []ModifyCommand
|
||||
|
Reference in New Issue
Block a user