panic when use version with uint32 type #1124

Closed
opened 2018-10-26 03:42:43 +00:00 by marshalys · 0 comments
marshalys commented 2018-10-26 03:42:43 +00:00 (Migrated from github.com)

I define struct like this:

type XXXStruct stuct {
……

Version   uint32    `xorm:"version"`

……
}

and when I call InsertOne method,I got this error:

reflect.Value.SetInt(0x16a0400, 0xc00036a810, 0x18a, 0x1)
/usr/local/Cellar/go/1.11.1/libexec/src/reflect/value.go:1475 +0x116
github.com/go-xorm/xorm.(*Session).innerInsert(0xc000118000, 0x16802e0, 0xc00036a7e0, 0x0, 0x0, 0x0)
/Users/xxx/go/pkg/mod/github.com/go-xorm/xorm@v0.7.1/session_insert.go:484 +0x13be
github.com/go-xorm/xorm.(*Session).InsertOne(0xc000118000, 0x16802e0, 0xc00036a7e0, 0x0, 0x0, 0x0)
/Users/xxx/go/pkg/mod/github.com/go-xorm/xorm@v0.7.1/session_insert.go:521 +0x62
github.com/go-xorm/xorm.(*Engine).InsertOne(0xc0001de000, 0x16802e0, 0xc00036a7e0, 0x0, 0x0, 0x0)
/Users/xxx/go/pkg/mod/github.com/go-xorm/xorm@v0.7.1/engine.go:1387 +0x8d

I define struct like this: type XXXStruct stuct { …… Version uint32 `xorm:"version"` …… } and when I call InsertOne method,I got this error: reflect.Value.SetInt(0x16a0400, 0xc00036a810, 0x18a, 0x1) /usr/local/Cellar/go/1.11.1/libexec/src/reflect/value.go:1475 +0x116 github.com/go-xorm/xorm.(*Session).innerInsert(0xc000118000, 0x16802e0, 0xc00036a7e0, 0x0, 0x0, 0x0) /Users/xxx/go/pkg/mod/github.com/go-xorm/xorm@v0.7.1/session_insert.go:484 +0x13be github.com/go-xorm/xorm.(*Session).InsertOne(0xc000118000, 0x16802e0, 0xc00036a7e0, 0x0, 0x0, 0x0) /Users/xxx/go/pkg/mod/github.com/go-xorm/xorm@v0.7.1/session_insert.go:521 +0x62 github.com/go-xorm/xorm.(*Engine).InsertOne(0xc0001de000, 0x16802e0, 0xc00036a7e0, 0x0, 0x0, 0x0) /Users/xxx/go/pkg/mod/github.com/go-xorm/xorm@v0.7.1/engine.go:1387 +0x8d
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: xorm/xorm#1124
No description provided.