You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Including the core import and using the flag import causes the testing imports flags to be included in parsing.
Output
~/s/g/t/tmp $ ./main -h
Usage of ./main:
-flag=10: A flag
-test.bench="": regular expression to select benchmarks to run
-test.benchmem=false: print memory allocations for benchmarks
-test.benchtime=1s: approximate run time for each benchmark
-test.blockprofile="": write a goroutine blocking profile to the named file after execution
-test.blockprofilerate=1: if >= 0, calls runtime.SetBlockProfileRate()
-test.coverprofile="": write a coverage profile to the named file after execution
-test.cpu="": comma-separated list of number of CPUs to use for each test
-test.cpuprofile="": write a cpu profile to the named file during execution
-test.memprofile="": write a memory profile to the named file after execution
-test.memprofilerate=0: if >=0, sets runtime.MemProfileRate
-test.outputdir="": directory in which to write profiles
-test.parallel=1: maximum test parallelism
-test.run="": regular expression to select tests and examples to run
-test.short=false: run smaller test suite to save time
-test.timeout=0: if positive, sets an aggregate time limit for all tests
-test.v=false: verbose: print additional output
~/s/g/t/tmp $
Expected output
~/s/g/t/tmp $ ./main -h
Usage of ./main:
-flag=10: A flag
Repo
package main
import (
core "github.com/jbenet/go-ipfs/core""flag""fmt"
)
funcmain() {
fake_flag:=flag.Int("flag", 10, "A flag")
flag.Parse()
node,_:=core.NewMockNode()
fmt.Println(*fake_flag)
fmt.Println(node)
}
As you can see the NewMockNode is included in the core package. This function uses the util/testutil which includes testing.
It would appear that the mock.go file should be mock_test.go as NewMockNode is only used in fuse/ipns/ipns_test.go.
The text was updated successfully, but these errors were encountered:
Including the
core
import and using theflag
import causes thetesting
imports flags to be included in parsing.Output
Expected output
Repo
As you can see the
NewMockNode
is included in the core package. This function uses theutil/testutil
which includestesting
.It would appear that the
mock.go
file should bemock_test.go
asNewMockNode
is only used infuse/ipns/ipns_test.go
.The text was updated successfully, but these errors were encountered: