Skip to content

Queue unexpected type conversion #26843

Closed
@KN4CK3R

Description

@KN4CK3R

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 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/needs-feedbackFor bugs, we need more details. For features, the feature must be described in more detail

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions