mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 02:44:59 +00:00
address meta-lint or half-baked lint fixes
Clean up some spelling and consistency issues for the lint fixes.
This commit is contained in:
parent
fc5fc4151b
commit
449c853850
7 changed files with 17 additions and 19 deletions
|
|
@ -239,7 +239,7 @@ func (s *attrStore) Blocks() (blocks []pilosa.AttrBlock, err error) {
|
|||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errors.Wrap(err, "getting blocks")
|
||||
}
|
||||
return blocks, nil
|
||||
}
|
||||
|
|
@ -271,7 +271,7 @@ func (s *attrStore) BlockData(i uint64) (m map[uint64]map[string]interface{}, er
|
|||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errors.Wrap(err, "getting block data")
|
||||
}
|
||||
return m, nil
|
||||
}
|
||||
|
|
|
|||
|
|
@ -710,8 +710,7 @@ func TestCluster_ResizeStates(t *testing.T) {
|
|||
|
||||
t.Run("Multiple nodes, in/not in topology", func(t *testing.T) {
|
||||
tc := NewClusterCluster(0)
|
||||
err := tc.addNode()
|
||||
if err != nil {
|
||||
if err := tc.addNode(); err != nil {
|
||||
t.Fatalf("adding node: %v", err)
|
||||
}
|
||||
node0 := tc.Clusters[0]
|
||||
|
|
@ -736,13 +735,11 @@ func TestCluster_ResizeStates(t *testing.T) {
|
|||
|
||||
// Expect an error by adding a node not in the topology.
|
||||
expectedError := "host is not in topology: node1"
|
||||
err = tc.addNode()
|
||||
if err == nil || err.Error() != expectedError {
|
||||
if err := tc.addNode(); err == nil || err.Error() != expectedError {
|
||||
t.Errorf("did not receive expected error: %s", expectedError)
|
||||
}
|
||||
|
||||
err = tc.addNode()
|
||||
if err != nil {
|
||||
if err := tc.addNode(); err != nil {
|
||||
t.Fatalf("adding node: %v", err)
|
||||
}
|
||||
node2 := tc.Clusters[2]
|
||||
|
|
@ -762,14 +759,13 @@ func TestCluster_ResizeStates(t *testing.T) {
|
|||
|
||||
t.Run("Multiple nodes, with data", func(t *testing.T) {
|
||||
tc := NewClusterCluster(0)
|
||||
err := tc.addNode()
|
||||
if err != nil {
|
||||
if err := tc.addNode(); err != nil {
|
||||
t.Fatalf("adding node: %v", err)
|
||||
}
|
||||
node0 := tc.Clusters[0]
|
||||
|
||||
// Open TestCluster.
|
||||
if err = tc.Open(); err != nil {
|
||||
if err := tc.Open(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
|
|
@ -792,8 +788,7 @@ func TestCluster_ResizeStates(t *testing.T) {
|
|||
node0Checksum := node0Fragment.Checksum()
|
||||
|
||||
// addNode needs to block until the resize process has completed.
|
||||
err = tc.addNode()
|
||||
if err != nil {
|
||||
if err := tc.addNode(); err != nil {
|
||||
t.Fatalf("adding node: %v", err)
|
||||
}
|
||||
node1 := tc.Clusters[1]
|
||||
|
|
|
|||
|
|
@ -51,11 +51,14 @@ Build Time: ` + pilosa.BuildTime + "\n",
|
|||
}
|
||||
|
||||
// return "dry run" error if "dry-run" flag is set
|
||||
if ret, err := cmd.Flags().GetBool("dry-run"); ret && err == nil {
|
||||
ret, err := cmd.Flags().GetBool("dry-run")
|
||||
if err != nil {
|
||||
return fmt.Errorf("problem getting dry-run flag: %v", err)
|
||||
}
|
||||
if ret {
|
||||
if cmd.Parent() != nil {
|
||||
return fmt.Errorf("dry run")
|
||||
}
|
||||
return fmt.Errorf("problem getting dry-run flag: %v", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ func (cmd *GenerateConfigCommand) Run(_ context.Context) error {
|
|||
conf := server.NewConfig()
|
||||
ret, err := toml.Marshal(*conf)
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "unmarshaling default config")
|
||||
return errors.Wrap(err, "unmarshalling default config")
|
||||
}
|
||||
fmt.Fprintf(cmd.Stdout, "%s\n", ret)
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ func (cmd *InspectCommand) Run(_ context.Context) error {
|
|||
}()
|
||||
// Attach the mmap file to the bitmap.
|
||||
t := time.Now()
|
||||
fmt.Fprintf(cmd.Stderr, "unmarshaling bitmap...")
|
||||
fmt.Fprintf(cmd.Stderr, "unmarshalling bitmap...")
|
||||
bm := roaring.NewBitmap()
|
||||
if err := bm.UnmarshalBinary(data); err != nil {
|
||||
return errors.Wrap(err, "unmarshalling")
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ func TestInspectCommand_Run(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatalf("copying data: %v", err)
|
||||
}
|
||||
if !strings.Contains(buf.String(), "unmarshaling bitmap...") {
|
||||
if !strings.Contains(buf.String(), "unmarshalling bitmap...") {
|
||||
t.Fatalf("Inspect doesn't work: %s", err)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -219,7 +219,7 @@ func TestField_AvailableShards(t *testing.T) {
|
|||
for i := uint64(0); i < 5; i++ {
|
||||
err := f.RemoveAvailableShard(i)
|
||||
if err != nil {
|
||||
t.Fatalf("removing shard: %v", err)
|
||||
t.Fatalf("removing shard %d: %v", i, err)
|
||||
}
|
||||
}
|
||||
if diff := cmp.Diff(f.AvailableShards().Slice(), []uint64{0, 2}); diff != "" {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue