Migration: go 1.18
This commit is contained in:
@ -51,7 +51,7 @@ func ValidAndSplitDomain(domain string) ([]string, bool) {
|
||||
// 3. subdomain.*.example.com
|
||||
// 4. .example.com
|
||||
// 5. +.example.com
|
||||
func (t *DomainTrie) Insert(domain string, data interface{}) error {
|
||||
func (t *DomainTrie) Insert(domain string, data any) error {
|
||||
parts, valid := ValidAndSplitDomain(domain)
|
||||
if !valid {
|
||||
return ErrInvalidDomain
|
||||
@ -68,7 +68,7 @@ func (t *DomainTrie) Insert(domain string, data interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *DomainTrie) insert(parts []string, data interface{}) {
|
||||
func (t *DomainTrie) insert(parts []string, data any) {
|
||||
node := t.root
|
||||
// reverse storage domain part to save space
|
||||
for i := len(parts) - 1; i >= 0; i-- {
|
||||
|
@ -3,7 +3,7 @@ package trie
|
||||
// Node is the trie's node
|
||||
type Node struct {
|
||||
children map[string]*Node
|
||||
Data interface{}
|
||||
Data any
|
||||
}
|
||||
|
||||
func (n *Node) getChild(s string) *Node {
|
||||
@ -18,7 +18,7 @@ func (n *Node) addChild(s string, child *Node) {
|
||||
n.children[s] = child
|
||||
}
|
||||
|
||||
func newNode(data interface{}) *Node {
|
||||
func newNode(data any) *Node {
|
||||
return &Node{
|
||||
Data: data,
|
||||
children: map[string]*Node{},
|
||||
|
Reference in New Issue
Block a user