Commit cac4ca7f authored by Janos Guljas's avatar Janos Guljas

fix lint warnings

parent 4ef1d3f5
package cmd_test
import (
"errors"
"fmt"
"io/ioutil"
"os"
"testing"
"time"
"github.com/janos/bee/cmd/bee/cmd"
)
var homeDir string
var errTest = errors.New("test error")
func TestMain(m *testing.M) {
dir, err := ioutil.TempDir("", "bee-cmd-")
if err != nil {
......@@ -37,13 +33,3 @@ func newCommand(t *testing.T, opts ...cmd.Option) (c *cmd.Command) {
}
return c
}
func newTime(t *testing.T, s string) (tm time.Time) {
t.Helper()
tm, err := time.Parse(time.RFC3339Nano, s)
if err != nil {
t.Fatal(err)
}
return tm
}
......@@ -11,11 +11,11 @@ var (
NewCommand = newCommand
)
func WithCfgFile(f string) func(c *Command) {
return func(c *Command) {
c.cfgFile = f
}
}
// func WithCfgFile(f string) func(c *Command) {
// return func(c *Command) {
// c.cfgFile = f
// }
// }
func WithHomeDir(dir string) func(c *Command) {
return func(c *Command) {
......@@ -29,11 +29,11 @@ func WithArgs(a ...string) func(c *Command) {
}
}
func WithInput(r io.Reader) func(c *Command) {
return func(c *Command) {
c.root.SetIn(r)
}
}
// func WithInput(r io.Reader) func(c *Command) {
// return func(c *Command) {
// c.root.SetIn(r)
// }
// }
func WithOutput(w io.Writer) func(c *Command) {
return func(c *Command) {
......@@ -41,8 +41,8 @@ func WithOutput(w io.Writer) func(c *Command) {
}
}
func WithErrorOutput(w io.Writer) func(c *Command) {
return func(c *Command) {
c.root.SetErr(w)
}
}
// func WithErrorOutput(w io.Writer) func(c *Command) {
// return func(c *Command) {
// c.root.SetErr(w)
// }
// }
......@@ -74,7 +74,9 @@ func (c *command) initStartCmd() (err error) {
cmd.Flags().String(optionNameListen, ":8500", "HTTP API listen address")
c.config.BindPFlags(cmd.Flags())
if err := c.config.BindPFlags(cmd.Flags()); err != nil {
return err
}
c.root.AddCommand(cmd)
return nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment