Merge pull request #11788 from reikani/pchoi
Changed snake case naming to camelCase.
This commit is contained in:
commit
9ddebf2114
2 changed files with 8 additions and 8 deletions
|
@ -260,7 +260,7 @@ func Exists(table Table, chain string, rule ...string) bool {
|
|||
|
||||
// parse "iptables -S" for the rule (this checks rules in a specific chain
|
||||
// in a specific table)
|
||||
rule_string := strings.Join(rule, " ")
|
||||
ruleString := strings.Join(rule, " ")
|
||||
existingRules, _ := exec.Command("iptables", "-t", string(table), "-S", chain).Output()
|
||||
|
||||
// regex to replace ips in rule
|
||||
|
@ -269,7 +269,7 @@ func Exists(table Table, chain string, rule ...string) bool {
|
|||
|
||||
return strings.Contains(
|
||||
re.ReplaceAllString(string(existingRules), "?"),
|
||||
re.ReplaceAllString(rule_string, "?"),
|
||||
re.ReplaceAllString(ruleString, "?"),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -941,11 +941,11 @@ func (f *FlagSet) parseOne() (bool, string, error) {
|
|||
|
||||
// it's a flag. does it have an argument?
|
||||
f.args = f.args[1:]
|
||||
has_value := false
|
||||
hasValue := false
|
||||
value := ""
|
||||
if i := strings.Index(name, "="); i != -1 {
|
||||
value = trimQuotes(name[i+1:])
|
||||
has_value = true
|
||||
hasValue = true
|
||||
name = name[:i]
|
||||
}
|
||||
|
||||
|
@ -962,7 +962,7 @@ func (f *FlagSet) parseOne() (bool, string, error) {
|
|||
return false, name, ErrRetry
|
||||
}
|
||||
if fv, ok := flag.Value.(boolFlag); ok && fv.IsBoolFlag() { // special case: doesn't need an arg
|
||||
if has_value {
|
||||
if hasValue {
|
||||
if err := fv.Set(value); err != nil {
|
||||
return false, "", f.failf("invalid boolean value %q for -%s: %v", value, name, err)
|
||||
}
|
||||
|
@ -971,12 +971,12 @@ func (f *FlagSet) parseOne() (bool, string, error) {
|
|||
}
|
||||
} else {
|
||||
// It must have a value, which might be the next argument.
|
||||
if !has_value && len(f.args) > 0 {
|
||||
if !hasValue && len(f.args) > 0 {
|
||||
// value is the next arg
|
||||
has_value = true
|
||||
hasValue = true
|
||||
value, f.args = f.args[0], f.args[1:]
|
||||
}
|
||||
if !has_value {
|
||||
if !hasValue {
|
||||
return false, "", f.failf("flag needs an argument: -%s", name)
|
||||
}
|
||||
if err := flag.Value.Set(value); err != nil {
|
||||
|
|
Loading…
Reference in a new issue