Changed snake case naming to camelCase

Signed-off-by: Peter Choi <phkchoi89@gmail.com>
This commit is contained in:
Peter Choi 2015-03-25 19:40:23 -06:00 committed by Peter Choi
parent 3b068ebe39
commit ecbb2a9d58
2 changed files with 8 additions and 8 deletions

View file

@ -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 // parse "iptables -S" for the rule (this checks rules in a specific chain
// in a specific table) // in a specific table)
rule_string := strings.Join(rule, " ") ruleString := strings.Join(rule, " ")
existingRules, _ := exec.Command("iptables", "-t", string(table), "-S", chain).Output() existingRules, _ := exec.Command("iptables", "-t", string(table), "-S", chain).Output()
// regex to replace ips in rule // regex to replace ips in rule
@ -269,7 +269,7 @@ func Exists(table Table, chain string, rule ...string) bool {
return strings.Contains( return strings.Contains(
re.ReplaceAllString(string(existingRules), "?"), re.ReplaceAllString(string(existingRules), "?"),
re.ReplaceAllString(rule_string, "?"), re.ReplaceAllString(ruleString, "?"),
) )
} }

View file

@ -941,11 +941,11 @@ func (f *FlagSet) parseOne() (bool, string, error) {
// it's a flag. does it have an argument? // it's a flag. does it have an argument?
f.args = f.args[1:] f.args = f.args[1:]
has_value := false hasValue := false
value := "" value := ""
if i := strings.Index(name, "="); i != -1 { if i := strings.Index(name, "="); i != -1 {
value = trimQuotes(name[i+1:]) value = trimQuotes(name[i+1:])
has_value = true hasValue = true
name = name[:i] name = name[:i]
} }
@ -962,7 +962,7 @@ func (f *FlagSet) parseOne() (bool, string, error) {
return false, name, ErrRetry return false, name, ErrRetry
} }
if fv, ok := flag.Value.(boolFlag); ok && fv.IsBoolFlag() { // special case: doesn't need an arg 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 { if err := fv.Set(value); err != nil {
return false, "", f.failf("invalid boolean value %q for -%s: %v", value, name, err) 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 { } else {
// It must have a value, which might be the next argument. // 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 // value is the next arg
has_value = true hasValue = true
value, f.args = f.args[0], f.args[1:] value, f.args = f.args[0], f.args[1:]
} }
if !has_value { if !hasValue {
return false, "", f.failf("flag needs an argument: -%s", name) return false, "", f.failf("flag needs an argument: -%s", name)
} }
if err := flag.Value.Set(value); err != nil { if err := flag.Value.Set(value); err != nil {