GoDoxy/internal/utils/trie/any_debug.go
2025-04-24 05:56:03 +08:00

13 lines
334 B
Go

//go:build debug
package trie
import "fmt"
func panicInvalidAssignment() {
// assigned anything after manually assigning nil
// will panic because of type mismatch (zeroValue and v.(type))
if r := recover(); r != nil {
panic(fmt.Errorf("attempt to assign non-nil value on edge node or assigning mismatched type: %v", r))
}
}