Skip to content

Commit

Permalink
don't shadow predeclared identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew LeFevre authored and Andrew LeFevre committed Sep 28, 2024
1 parent 301b710 commit e59e27f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions cmd/whalewall/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func main() {
}

func mainRetCode() int {
clear := flag.Bool("clear", false, "remove all firewall rules created by whalewall")
clearRules := flag.Bool("clear", false, "remove all firewall rules created by whalewall")
dataDir := flag.String("d", ".", "directory to store state in")
debugLogs := flag.Bool("debug", false, "enable debug logging")
logPath := flag.String("l", "stdout", "path to log to")
Expand Down Expand Up @@ -102,7 +102,7 @@ func mainRetCode() int {
}

// remove all created firewall rules if the user asked to clear
if *clear {
if *clearRules {
logger.Info("clearing rules")
if err := r.Clear(ctx, sqliteFile); err != nil {
logger.Error("error clearing rules", zap.Error(err))
Expand Down
8 changes: 4 additions & 4 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,17 +276,17 @@ func (p *rulePorts) UnmarshalText(text []byte) error {

var parsedPorts rulePorts
if intervalIdx != 0 {
min, err := strconv.ParseUint(string(text[:intervalIdx]), 10, 16)
intervalMin, err := strconv.ParseUint(string(text[:intervalIdx]), 10, 16)
if err != nil {
return fmt.Errorf("error parsing start of port interval: %w", err)
}
max, err := strconv.ParseUint(string(text[intervalIdx+1:]), 10, 16)
intervalMax, err := strconv.ParseUint(string(text[intervalIdx+1:]), 10, 16)
if err != nil {
return fmt.Errorf("error parsing end of port interval: %w", err)
}
parsedPorts.interval = portInterval{
min: uint16(min),
max: uint16(max),
min: uint16(intervalMin),
max: uint16(intervalMax),
}
} else {
port, err := strconv.ParseUint(string(text), 10, 16)
Expand Down

0 comments on commit e59e27f

Please sign in to comment.