Skip to content

Commit

Permalink
*: pass go vet
Browse files Browse the repository at this point in the history
pass go vet
  • Loading branch information
zimulala committed Sep 6, 2015
1 parent 9238a23 commit 66253f0
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
2 changes: 1 addition & 1 deletion expression/expressions/unary_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (s *testUnaryOperationSuite) TestUnaryOp(c *C) {
}{
{mysql.NewDecimalFromInt(1, 0), opcode.Plus, mysql.NewDecimalFromInt(1, 0)},
{mysql.Duration{Duration: time.Duration(838*3600 + 59*60 + 59), Fsp: mysql.DefaultFsp}, opcode.Plus,
mysql.Duration{Druation: time.Duration(838*3600 + 59*60 + 59), Fsp: mysql.DefaultFsp}},
mysql.Duration{Duration: time.Duration(838*3600 + 59*60 + 59), Fsp: mysql.DefaultFsp}},
{mysql.Time{Time: time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC), Type: mysql.TypeDatetime, Fsp: 0}, opcode.Plus, mysql.Time{Time: time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC), Type: mysql.TypeDatetime, Fsp: 0}},

{mysql.NewDecimalFromInt(1, 0), opcode.Minus, mysql.NewDecimalFromInt(-1, 0)},
Expand Down
Binary file removed meta/autoid/.autoid_test.go.swp
Binary file not shown.
2 changes: 1 addition & 1 deletion table/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func (*testSuite) TestT(c *C) {
Name: model.NewCIStr("t"),
}
c.Assert(ident.String(), Not(Equals), "")
driver := localstore.Driver{goleveldb.MemoryDriver{}}
driver := localstore.Driver{Driver: goleveldb.MemoryDriver{}}
store, err := driver.Open("memory")
c.Assert(err, IsNil)
se, err := tidb.CreateSession(store)
Expand Down
2 changes: 1 addition & 1 deletion table/tables/tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TableFromMeta(dbname string, alloc autoid.Allocator, tblInfo *model.TableIn
t := NewTable(tblInfo.ID, tblInfo.Name.O, dbname, nil, alloc)

for _, colInfo := range tblInfo.Columns {
c := column.Col{*colInfo}
c := column.Col{ColumnInfo: *colInfo}
t.Columns = append(t.Columns, &c)
}

Expand Down
2 changes: 1 addition & 1 deletion table/tables/tables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type testSuite struct {

func (ts *testSuite) SetUpSuite(c *C) {
table.TableFromMeta = tables.TableFromMeta
driver := localstore.Driver{goleveldb.MemoryDriver{}}
driver := localstore.Driver{Driver: goleveldb.MemoryDriver{}}
store, err := driver.Open("memory")
c.Check(err, IsNil)
ts.store = store
Expand Down
2 changes: 1 addition & 1 deletion util/prefix_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type testPrefixSuite struct {
func (s *testPrefixSuite) SetUpSuite(c *C) {
path := "memory:"
d := localstore.Driver{
goleveldb.MemoryDriver{},
Driver: goleveldb.MemoryDriver{},
}
store, err := d.Open(path)
c.Assert(err, IsNil)
Expand Down
21 changes: 12 additions & 9 deletions util/types/etc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,16 @@ func (s *testTypeEtcSuite) TestCompare(c *C) {
checkCompare(c, []byte(""), []byte("sff"), -1)

checkCompare(c, mysql.Time{}, nil, 1)
checkCompare(c, mysql.Time{}, mysql.Time{time.Now(), 1, 3}, -1)
checkCompare(c, mysql.Time{time.Now(), 1, 3}, "11:11", 1)
checkCompare(c, mysql.Time{}, mysql.Time{Time: time.Now(), Type: 1, Fsp: 3}, -1)
checkCompare(c, mysql.Time{Time: time.Now(), Type: 1, Fsp: 3}, "11:11", 1)

checkCompare(c, mysql.Duration{time.Duration(34), 2}, nil, 1)
checkCompare(c, mysql.Duration{time.Duration(34), 2}, mysql.Duration{time.Duration(29034), 2}, -1)
checkCompare(c, mysql.Duration{time.Duration(3340), 2}, mysql.Duration{time.Duration(34), 2}, 1)
checkCompare(c, mysql.Duration{time.Duration(34), 2}, mysql.Duration{time.Duration(34), 2}, 0)
checkCompare(c, mysql.Duration{Duration: time.Duration(34), Fsp: 2}, nil, 1)
checkCompare(c, mysql.Duration{Duration: time.Duration(34), Fsp: 2},
mysql.Duration{Duration: time.Duration(29034), Fsp: 2}, -1)
checkCompare(c, mysql.Duration{Duration: time.Duration(3340), Fsp: 2},
mysql.Duration{Duration: time.Duration(34), Fsp: 2}, 1)
checkCompare(c, mysql.Duration{Duration: time.Duration(34), Fsp: 2},
mysql.Duration{Duration: time.Duration(34), Fsp: 2}, 0)

checkCompare(c, mysql.Decimal{}, mysql.Decimal{}, 0)
}
Expand Down Expand Up @@ -216,9 +219,9 @@ func (s *testTypeEtcSuite) TestClone(c *C) {
checkClone(c, "abcd1.c--/+!%^", true)
checkClone(c, []byte("aa028*(%^"), true)
checkClone(c, []interface{}{1, 2}, true)
checkClone(c, mysql.Duration{time.Duration(32), 0}, true)
checkClone(c, mysql.Duration{Duration: time.Duration(32), Fsp: 0}, true)
checkClone(c, mysql.Decimal{}, true)
checkClone(c, mysql.Time{time.Now(), 1, 3}, true)
checkClone(c, mysql.Time{Time: time.Now(), Type: 1, Fsp: 3}, true)
checkClone(c, make(map[int]string), false)
}

Expand Down Expand Up @@ -286,7 +289,7 @@ func (s *testTypeEtcSuite) TestIsOrderedType(c *C) {
c.Assert(err, IsNil)
c.Assert(r, IsTrue)

_, r, err = IsOrderedType(mysql.Duration{time.Duration(0), 0})
_, r, err = IsOrderedType(mysql.Duration{Duration: time.Duration(0), Fsp: 0})
c.Assert(err, IsNil)
c.Assert(r, IsTrue)
}
Expand Down

0 comments on commit 66253f0

Please sign in to comment.