Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix go vet warnings #4859

Merged
merged 1 commit into from
Mar 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func setupNode(ctx context.Context, n *IpfsNode, cfg *BuildCfg) error {

// hash security
bs := bstore.NewBlockstore(rds)
bs = &verifbs.VerifBS{bs}
bs = &verifbs.VerifBS{Blockstore: bs}

opts := bstore.DefaultCacheOpts()
conf, err := n.Repo.Config()
Expand Down Expand Up @@ -202,7 +202,7 @@ func setupNode(ctx context.Context, n *IpfsNode, cfg *BuildCfg) error {
// hash security
n.Filestore = filestore.NewFilestore(bs, n.Repo.FileManager())
n.Blockstore = bstore.NewGCBlockstore(n.Filestore, n.GCLocker)
n.Blockstore = &verifbs.VerifBSGC{n.Blockstore}
n.Blockstore = &verifbs.VerifBSGC{GCBlockstore: n.Blockstore}
}

rcfg, err := n.Repo.Config()
Expand Down
2 changes: 1 addition & 1 deletion filestore/fsrefstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (f *FileManager) AllKeysChan(ctx context.Context) (<-chan *cid.Cid, error)
k := ds.RawKey(v.Key)
c, err := dshelp.DsKeyToCid(k)
if err != nil {
log.Error("decoding cid from filestore: %s", err)
log.Errorf("decoding cid from filestore: %s", err)
continue
}

Expand Down
1 change: 0 additions & 1 deletion repo/fsrepo/fsrepo.go
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,6 @@ func (r *FSRepo) SetConfigKey(key string, value interface{}) error {
case string:
value, ok = value.(string)
default:
value = value
}
if !ok {
return fmt.Errorf("Wrong config type, expected %T", oldValue)
Expand Down
3 changes: 2 additions & 1 deletion test/dependencies/go-timeout/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ func main() {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
os.Exit(1)
}
ctx, _ := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), time.Duration(timeout)*time.Second)
defer cancel()

cmd := exec.CommandContext(ctx, os.Args[2], os.Args[3:]...)
cmd.Stdin = os.Stdin
Expand Down
4 changes: 2 additions & 2 deletions thirdparty/notifier/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ type Notifier struct {
// RateLimited returns a rate limited Notifier. only limit goroutines
// will be spawned. If limit is zero, no rate limiting happens. This
// is the same as `Notifier{}`.
func RateLimited(limit int) Notifier {
n := Notifier{}
func RateLimited(limit int) *Notifier {
n := &Notifier{}
if limit > 0 {
n.lim = ratelimit.NewRateLimiter(process.Background(), limit)
}
Expand Down