Skip to content

Commit

Permalink
Replaced magic number used for the Tabwriter.
Browse files Browse the repository at this point in the history
  • Loading branch information
bengarrett committed Nov 4, 2021
1 parent 24d25b0 commit 2a37592
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ const (
job4
)

// Default HTTP request timeout value in milliseconds.
const httpTimeout = 5000
const (
// Default HTTP request timeout value in milliseconds.
httpTimeout = 5000
// Tabwriter padding using spaces.
padding = 4
)

var (
version = "0.0.0"
Expand All @@ -70,7 +74,7 @@ func main() {
fmt.Fprintln(os.Stderr, "MyIP Usage:")
fmt.Fprintln(os.Stderr, " myip [options]:")
fmt.Fprintln(os.Stderr, "")
w := tabwriter.NewWriter(os.Stderr, 0, 0, 4, ' ', 0)
w := tabwriter.NewWriter(os.Stderr, 0, 0, padding, ' ', 0)
fmt.Fprintln(w, " -h, --help\tshow this list of options")
flag.VisitAll(func(f *flag.Flag) {
if len(f.Name) == alias {
Expand Down

0 comments on commit 2a37592

Please # to comment.