Skip to content

unique: panic when calling unique.Make with string casted as any #68990

@ALX99

Description

@ALX99

Go version

go version go1.23.0 linux/amd64

Output of go env in your module/workspace:

Go playground

What did you do?

Casting a string to any and passing it to unique.Make seems to cause issues.

package main

import "unique"

func main() {
	unique.Make(any(""))
}

Example crash 1 unexpected fault address 0x912c08: https://go.dev/play/p/vZWwiXU6YXL
Example crash 2 panic: interface conversion: interface {} is *unique.uniqueMap[string], not *unique.uniqueMap[interface {}]: https://go.dev/play/p/U8JvXsqXpJQ

What did you see happen?

For it not to crash

What did you expect to see?

I expected to see nothing and the program not to crash

Metadata

Metadata

Assignees

Labels

NeedsFixThe path to resolution is known, but the work has not been done.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions