Skip to content

Commit

Permalink
Merge f0fd541 into 1fedbea
Browse files Browse the repository at this point in the history
  • Loading branch information
wolveix committed Jul 17, 2020
2 parents 1fedbea + f0fd541 commit dae81a0
Show file tree
Hide file tree
Showing 7 changed files with 102 additions and 103 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -281,7 +281,7 @@ to create the database, create the tables you expect, and create any indexes. W
and put any type of data you want in it.

```Go
store, err := badgerhold.Open(filename, 0666, nil)
store, err := badgerhold.Open(badgerhold.DefaultOptions(filename))
if err != nil {
//handle error
}
Expand Down
12 changes: 6 additions & 6 deletions compare_test.go
Expand Up @@ -37,7 +37,7 @@ func (i *ItemTest) Compare(other interface{}) (int, error) {
func TestFindWithComparer(t *testing.T) {
testWrap(t, func(store *badgerhold.Store, t *testing.T) {
data := []CItemTest{
CItemTest{
{
Inner: ItemTest{
Key: 0,
ID: 0,
Expand All @@ -46,7 +46,7 @@ func TestFindWithComparer(t *testing.T) {
Created: time.Now().AddDate(-1, 0, 0),
},
},
CItemTest{
{
Inner: ItemTest{
Key: 1,
ID: 1,
Expand All @@ -55,7 +55,7 @@ func TestFindWithComparer(t *testing.T) {
Created: time.Now().AddDate(0, 30, 0),
},
},
CItemTest{
{
Inner: ItemTest{
Key: 2,
ID: 2,
Expand Down Expand Up @@ -149,7 +149,7 @@ var allCurrent = All{ // current
}

var allData = []All{
All{ // equal
{ // equal
ATime: time.Date(2016, 1, 1, 0, 0, 0, 0, time.Local),
AFloat: big.NewFloat(30.5),
AInt: big.NewInt(123),
Expand All @@ -173,7 +173,7 @@ var allData = []All{
Astring: "btest",
ADefault: DefaultType{"btest"},
},
All{ // greater
{ // greater
ATime: time.Date(2017, 1, 1, 0, 0, 0, 0, time.Local),
AFloat: big.NewFloat(31.5),
AInt: big.NewInt(128),
Expand All @@ -197,7 +197,7 @@ var allData = []All{
Astring: "ctest",
ADefault: DefaultType{"ctest"},
},
All{ // less
{ // less
ATime: time.Date(2015, 1, 1, 0, 0, 0, 0, time.Local),
AFloat: big.NewFloat(30.1),
AInt: big.NewInt(121),
Expand Down
8 changes: 4 additions & 4 deletions example_test.go
Expand Up @@ -22,22 +22,22 @@ type Item struct {

func Example() {
data := []Item{
Item{
{
ID: 0,
Category: "blue",
Created: time.Now().Add(-4 * time.Hour),
},
Item{
{
ID: 1,
Category: "red",
Created: time.Now().Add(-3 * time.Hour),
},
Item{
{
ID: 2,
Category: "blue",
Created: time.Now().Add(-2 * time.Hour),
},
Item{
{
ID: 3,
Category: "blue",
Created: time.Now().Add(-20 * time.Minute),
Expand Down

0 comments on commit dae81a0

Please sign in to comment.