diff --git a/commands.go b/commands.go index 6816b6b..ec98535 100644 --- a/commands.go +++ b/commands.go @@ -18,7 +18,7 @@ const ( type Options struct { IPVersion int - Preview bool + Preview bool } // PrintErrLn will print to stderr followed by a newline @@ -259,7 +259,6 @@ func Apply(options *Options, filename string) error { return err } - if err := hostfile.Hosts.Apply(jsonbytes); err != nil { return fmt.Errorf("Error applying changes to hosts file: %s", err) } diff --git a/commands_test.go b/commands_test.go index ba7f0a0..18a2d24 100644 --- a/commands_test.go +++ b/commands_test.go @@ -2,14 +2,14 @@ package main import ( "testing" - ) +) func TestStrPadRight(t *testing.T) { type testCase struct { Expected string - Output string - Name string + Output string + Name string } cases := []testCase{ diff --git a/main.go b/main.go index e3b7969..bb9f13b 100644 --- a/main.go +++ b/main.go @@ -67,9 +67,9 @@ func CommandUsage(command string) error { func wrappedMain() error { cli := flag.NewFlagSet(os.Args[0], flag.ExitOnError) - ipv4 := cli.Bool("4",false, "IPv4") - ipv6 := cli.Bool("6",false, "IPv6") - preview := cli.Bool("n",false, "preview") + ipv4 := cli.Bool("4", false, "IPv4") + ipv6 := cli.Bool("6", false, "IPv6") + preview := cli.Bool("n", false, "preview") cli.Usage = func() { fmt.Printf(help, hostess.GetHostsPath()) } @@ -83,10 +83,10 @@ func wrappedMain() error { Preview: *preview, } if *ipv4 { - options.IPVersion = options.IPVersion| IPv4 + options.IPVersion = options.IPVersion | IPv4 } if *ipv6 { - options.IPVersion = options.IPVersion| IPv6 + options.IPVersion = options.IPVersion | IPv6 } command := cli.Arg(0)