gitea: Queue unexpected type conversion
Description
q := queue.CreateSimpleQueue(
graceful.GetManager().ShutdownContext(),
"interface",
func(data ...any) []any {
for _, d := range data {
fmt.Printf("<- %#v (%T)\n", d, d)
}
return nil
},
)
go graceful.GetManager().RunWithCancel(q)
push := func(val any) {
fmt.Printf("-> %#v (%T)\n", val, val)
q.Push(val)
}
push(int64(1))
push(1)
Expected:
-> 1 (int64)
<- 1 (int64)
-> 1 (int)
<- 1 (int)
Actual:
-> 1 (int64)
<- 1 (float64)
-> 1 (int)
<- 1 (float64)
Somewhere there is an unexpected type conversion in the code.
@wxiaoguang You touched the queues last, it’s yours 😄
About this issue
- Original URL
- State: closed
- Created 10 months ago
- Comments: 16 (16 by maintainers)
Commits related to this issue
- Document the queue item's marshaling behavior (#27271) Close #26843 — committed to go-gitea/gitea by wxiaoguang 9 months ago
Didn’t see any problem, what’s your code?