Skip to content

Commit

Permalink
index columns zero value is []string(nil) but not []string{} (#383)
Browse files Browse the repository at this point in the history
* columns zero value is []string(nil) but not []string{}

* fix entity_parse unit test
  • Loading branch information
skywhat authored Jun 10, 2019
1 parent 9b23cfc commit e8a173b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ type IndexDefinition struct {

// Clone returns a deep copy of IndexDefinition
func (id *IndexDefinition) Clone() *IndexDefinition {
columns := make([]string, len(id.Columns))
var columns []string
copy(columns, id.Columns)
return &IndexDefinition{
Key: id.Key.Clone(),
Expand Down
2 changes: 0 additions & 2 deletions entity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,14 +358,12 @@ func getValidEntityDefinition() *dosa.EntityDefinition {
},
},
},
Columns: []string{},
},

"index2": {
Key: &dosa.PrimaryKey{
PartitionKeys: []string{"bar"},
},
Columns: []string{},
},
},
Columns: []*dosa.ColumnDefinition{
Expand Down

0 comments on commit e8a173b

Please sign in to comment.