mirror of
https://github.com/safing/portmaster
synced 2025-09-02 10:39:22 +00:00
Fix linter warnings
This commit is contained in:
parent
5580cbf4a4
commit
fe6af5f263
4 changed files with 7 additions and 7 deletions
|
@ -74,7 +74,7 @@ func registerComponent(opts []Options) {
|
||||||
Use: opt.ShortIdentifier,
|
Use: opt.ShortIdentifier,
|
||||||
Short: "Run the " + opt.Name,
|
Short: "Run the " + opt.Name,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
err := run(cmd, opt, args)
|
err := run(opt, args)
|
||||||
initiateShutdown(err)
|
initiateShutdown(err)
|
||||||
return err
|
return err
|
||||||
},
|
},
|
||||||
|
@ -86,7 +86,7 @@ func registerComponent(opts []Options) {
|
||||||
Use: opt.ShortIdentifier,
|
Use: opt.ShortIdentifier,
|
||||||
Short: "Show command to execute the " + opt.Name,
|
Short: "Show command to execute the " + opt.Name,
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
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
|
return args
|
||||||
}
|
}
|
||||||
|
|
||||||
func run(cmd *cobra.Command, opts *Options, cmdArgs []string) (err error) {
|
func run(opts *Options, cmdArgs []string) (err error) {
|
||||||
// set download option
|
// set download option
|
||||||
registry.Online = opts.AllowDownload
|
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 {
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -122,7 +122,7 @@ func runService(cmd *cobra.Command, opts *Options, cmdArgs []string) error {
|
||||||
go func() {
|
go func() {
|
||||||
// run slightly delayed
|
// run slightly delayed
|
||||||
time.Sleep(250 * time.Millisecond)
|
time.Sleep(250 * time.Millisecond)
|
||||||
err := run(cmd, opts, getExecArgs(opts, cmdArgs))
|
err := run(opts, getExecArgs(opts, cmdArgs))
|
||||||
initiateShutdown(err)
|
initiateShutdown(err)
|
||||||
finishWg.Done()
|
finishWg.Done()
|
||||||
runWg.Done()
|
runWg.Done()
|
||||||
|
|
|
@ -21,7 +21,7 @@ var showCmd = &cobra.Command{
|
||||||
Short: "Show the command to run a Portmaster component yourself",
|
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
|
// get original arguments
|
||||||
args := getExecArgs(opts, cmdArgs)
|
args := getExecArgs(opts, cmdArgs)
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ var versionCmd = &cobra.Command{
|
||||||
func init() {
|
func init() {
|
||||||
flags := versionCmd.Flags()
|
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.")
|
flags.BoolVar(&showAllVersions, "all", false, "Dump versions for all components.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue