Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mybee
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
mybee
Commits
cac4ca7f
Commit
cac4ca7f
authored
Jan 21, 2020
by
Janos Guljas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix lint warnings
parent
4ef1d3f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
30 deletions
+18
-30
cmd_test.go
cmd/bee/cmd/cmd_test.go
+0
-14
export_test.go
cmd/bee/cmd/export_test.go
+15
-15
start.go
cmd/bee/cmd/start.go
+3
-1
No files found.
cmd/bee/cmd/cmd_test.go
View file @
cac4ca7f
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
}
cmd/bee/cmd/export_test.go
View file @
cac4ca7f
...
...
@@ -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)
//
}
//
}
cmd/bee/cmd/start.go
View file @
cac4ca7f
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment