Fix linter warnings

This commit is contained in:
Patrick Pacher 2020-07-16 15:54:37 +02:00
parent 5580cbf4a4
commit fe6af5f263
No known key found for this signature in database
GPG key ID: E8CD2DA160925A6D
4 changed files with 7 additions and 7 deletions

View file

@ -74,7 +74,7 @@ func registerComponent(opts []Options) {
Use: opt.ShortIdentifier,
Short: "Run the " + opt.Name,
RunE: func(cmd *cobra.Command, args []string) error {
err := run(cmd, opt, args)
err := run(opt, args)
initiateShutdown(err)
return err
},
@ -86,7 +86,7 @@ func registerComponent(opts []Options) {
Use: opt.ShortIdentifier,
Short: "Show command to execute the " + opt.Name,
RunE: func(cmd *cobra.Command, args []string) error {
return show(cmd, opt, args)
return show(opt, args)
},
},
)
@ -106,7 +106,7 @@ func getExecArgs(opts *Options, cmdArgs []string) []string {
return args
}
func run(cmd *cobra.Command, opts *Options, cmdArgs []string) (err error) {
func run(opts *Options, cmdArgs []string) (err error) {
// set download option
registry.Online = opts.AllowDownload
@ -230,7 +230,7 @@ func copyLogs(opts *Options, consoleSink io.Writer, version, ext string, logSour
}
if bytes, err := io.Copy(sink, logSource); err != nil {
log.Printf("%s: writting logs failed after %d bytes: %s", fileSink.Name(), bytes, err)
log.Printf("%s: writing logs failed after %d bytes: %s", fileSink.Name(), bytes, err)
}
}

View file

@ -122,7 +122,7 @@ func runService(cmd *cobra.Command, opts *Options, cmdArgs []string) error {
go func() {
// run slightly delayed
time.Sleep(250 * time.Millisecond)
err := run(cmd, opts, getExecArgs(opts, cmdArgs))
err := run(opts, getExecArgs(opts, cmdArgs))
initiateShutdown(err)
finishWg.Done()
runWg.Done()

View file

@ -21,7 +21,7 @@ var showCmd = &cobra.Command{
Short: "Show the command to run a Portmaster component yourself",
}
func show(cmd *cobra.Command, opts *Options, cmdArgs []string) error {
func show(opts *Options, cmdArgs []string) error {
// get original arguments
args := getExecArgs(opts, cmdArgs)

View file

@ -71,7 +71,7 @@ var versionCmd = &cobra.Command{
func init() {
flags := versionCmd.Flags()
{
flags.BoolVar(&showShortVersion, "short", false, "Print only the verison number.")
flags.BoolVar(&showShortVersion, "short", false, "Print only the version number.")
flags.BoolVar(&showAllVersions, "all", false, "Dump versions for all components.")
}