diff --git a/cmd/admin-helper/add.go b/cmd/admin-helper/add.go index c8d292c0..6fc51561 100644 --- a/cmd/admin-helper/add.go +++ b/cmd/admin-helper/add.go @@ -11,7 +11,7 @@ var Add = &cobra.Command{ Use: "add", Aliases: []string{"a"}, Short: "Add an entry to the hostsfile", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { return add(args) }, } diff --git a/cmd/admin-helper/clean.go b/cmd/admin-helper/clean.go index e806058d..0f086ea0 100644 --- a/cmd/admin-helper/clean.go +++ b/cmd/admin-helper/clean.go @@ -10,7 +10,7 @@ import ( var Clean = &cobra.Command{ Use: "clean", Short: "Clean all entries added with a particular suffix", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { return clean(args) }, } diff --git a/cmd/admin-helper/contains.go b/cmd/admin-helper/contains.go index 19214eb7..287c3dd2 100644 --- a/cmd/admin-helper/contains.go +++ b/cmd/admin-helper/contains.go @@ -11,7 +11,7 @@ var Contains = &cobra.Command{ Use: "contains", Short: "Check if an ip and host are present in hosts file", Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { return contains(args) }, } diff --git a/cmd/admin-helper/daemon.go b/cmd/admin-helper/daemon.go index 1f256d89..5199d9d6 100644 --- a/cmd/admin-helper/daemon.go +++ b/cmd/admin-helper/daemon.go @@ -44,7 +44,7 @@ var UninstallDaemon = &cobra.Command{ var Daemon = &cobra.Command{ Use: "daemon", Short: "Run as a daemon", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { return daemon() }, } diff --git a/cmd/admin-helper/remove.go b/cmd/admin-helper/remove.go index 790a0bde..e8af3c94 100644 --- a/cmd/admin-helper/remove.go +++ b/cmd/admin-helper/remove.go @@ -9,7 +9,7 @@ var Remove = &cobra.Command{ Use: "remove", Aliases: []string{"rm", "r"}, Short: "Remove host(s) if exists", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, args []string) error { return remove(args) }, } diff --git a/pkg/api/mux.go b/pkg/api/mux.go index 35c62f91..65d640e3 100644 --- a/pkg/api/mux.go +++ b/pkg/api/mux.go @@ -12,7 +12,7 @@ import ( func Mux(hosts *hosts.Hosts) http.Handler { mux := http.NewServeMux() - mux.HandleFunc("/version", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/version", func(w http.ResponseWriter, _ *http.Request) { _, _ = fmt.Fprint(w, constants.Version) }) mux.HandleFunc("/add", func(w http.ResponseWriter, r *http.Request) { diff --git a/pkg/hosts/hosts_test.go b/pkg/hosts/hosts_test.go index a0451fc2..90c7f4dd 100644 --- a/pkg/hosts/hosts_test.go +++ b/pkg/hosts/hosts_test.go @@ -240,7 +240,7 @@ func hosts(t *testing.T, hostsFile string) Hosts { assert.NoError(t, err) return Hosts{ File: file, - HostFilter: func(s string) bool { + HostFilter: func(_ string) bool { return true }, }