feat: trie implementation

This commit is contained in:
yusing
2025-04-24 05:56:03 +08:00
parent 4a65de99a8
commit ec8cca1245
15 changed files with 699 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
//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))
}
}