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