fix govet warnings
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
Łukasz Magiera committed
Mar 22, 2018 at 04:01 UTC
221652fcfbbe5b994d885480229a12226642cdf2
5 files changed
+7
-7
core/builder.go
+2
-2
@@ -173,7 +173,7 @@ func setupNode(ctx context.Context, n *IpfsNode, cfg *BuildCfg) error {
173
174
// hash security
175
bs := bstore.NewBlockstore(rds)
176
- bs = &verifbs.VerifBS{bs}
176
+ bs = &verifbs.VerifBS{Blockstore: bs}
177
178
opts := bstore.DefaultCacheOpts()
179
conf, err := n.Repo.Config()
@@ -202,7 +202,7 @@ func setupNode(ctx context.Context, n *IpfsNode, cfg *BuildCfg) error {
202
// hash security
203
n.Filestore = filestore.NewFilestore(bs, n.Repo.FileManager())
204
n.Blockstore = bstore.NewGCBlockstore(n.Filestore, n.GCLocker)
205
- n.Blockstore = &verifbs.VerifBSGC{n.Blockstore}
205
+ n.Blockstore = &verifbs.VerifBSGC{GCBlockstore: n.Blockstore}
206
}
207
208
rcfg, err := n.Repo.Config()
filestore/fsrefstore.go
+1
-1
@@ -77,7 +77,7 @@ func (f *FileManager) AllKeysChan(ctx context.Context) (<-chan *cid.Cid, error)
77
k := ds.RawKey(v.Key)
78
c, err := dshelp.DsKeyToCid(k)
79
if err != nil {
80
- log.Error("decoding cid from filestore: %s", err)
80
+ log.Errorf("decoding cid from filestore: %s", err)
81
continue
82
}
83
repo/fsrepo/fsrepo.go
-1
@@ -619,7 +619,6 @@ func (r *FSRepo) SetConfigKey(key string, value interface{}) error {
619
case string:
620
value, ok = value.(string)
621
default:
622
- value = value
622
}
623
if !ok {
624
return fmt.Errorf("Wrong config type, expected %T", oldValue)
test/dependencies/go-timeout/main.go
+2
-1
@@ -21,7 +21,8 @@ func main() {
21
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
22
os.Exit(1)
23
}
24
- ctx, _ := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second)
24
+ ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second)
25
+ defer cancel()
26
27
cmd := exec.CommandContext(ctx, os.Args[2], os.Args[3:]...)
28
cmd.Stdin = os.Stdin
thirdparty/notifier/notifier.go
+2
-2
@@ -40,8 +40,8 @@ type Notifier struct {
40
// RateLimited returns a rate limited Notifier. only limit goroutines
41
// will be spawned. If limit is zero, no rate limiting happens. This
42
// is the same as `Notifier{}`.
43
-func RateLimited(limit int) Notifier {
44
- n := Notifier{}
43
+func RateLimited(limit int) *Notifier {
44
+ n := &Notifier{}
45
if limit > 0 {
46
n.lim = ratelimit.NewRateLimiter(process.Background(), limit)
47
}