一次執行多組 test case 遇到 encoding/gob.RegisterName Error #1490
Labels
No Label
backport/done
backport/v1
blocked
db
oracle
db
sqlserver
duplicate
feature
cache
frontport/done
frontport/main
invalid
kind
breaking
kind
bug
kind
build
kind
dependencies
kind
docs
kind
driver
kind
enhancement
kind
feature
kind
performance
kind
proposal
kind
question
kind
refactor
kind
testing
need
feedback
need
test
proposal:accepted
RaspBerry Pi
regression
skip-changelog
upstream
wip
wontfix
No Milestone
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: xorm/xorm#1490
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
您好,我在撰寫 unit test 時,分別獨立執行是不會有問題的,但一次 run 整個 package 測試則會發生以下錯誤:
panic: gob: registering duplicate names for *models.Friend: "xxx-go/models.Friend" != "*models.Friend" [recovered]
panic: gob: registering duplicate names for *models.Friend: "xxx-go/models.Friend" != "*models.Friend"
ps: 其中一組 test 是單獨 insert, 另一組是批次 insert
@Rainlay You cannot register the same name struct on an engine.
xxx-go/models.Friend
andmodels.Friend
have the same name.@lunny can you explain how to avoid this situation, I know is duplicate register, but I am not sure why this happened.
Because we use gob to register struct but it doesn't allow duplicated name.