chore: change interface{} to any (#2818)

* chore: change interface{} to any

* chore: update goctl version to 1.5.0

* chore: update goctl deps
This commit is contained in:
Kevin Wan
2023-01-24 16:32:02 +08:00
committed by GitHub
parent 7e0ac77139
commit ae87114282
221 changed files with 1910 additions and 2207 deletions

View File

@@ -35,7 +35,7 @@ type (
}
node struct {
item interface{}
item any
children [2]map[string]*node
}
@@ -46,7 +46,7 @@ type (
// A Result is a search result from tree.
Result struct {
Item interface{}
Item any
Params map[string]string
}
)
@@ -59,7 +59,7 @@ func NewTree() *Tree {
}
// Add adds item to associate with route.
func (t *Tree) Add(route string, item interface{}) error {
func (t *Tree) Add(route string, item any) error {
if len(route) == 0 || route[0] != slash {
return errNotFromRoot
}
@@ -149,7 +149,7 @@ func (nd *node) getChildren(route string) map[string]*node {
return nd.children[0]
}
func add(nd *node, route string, item interface{}) error {
func add(nd *node, route string, item any) error {
if len(route) == 0 {
if nd.item != nil {
return errDupItem
@@ -228,7 +228,7 @@ func match(pat, token string) innerResult {
}
}
func newNode(item interface{}) *node {
func newNode(item any) *node {
return &node{
item: item,
children: [2]map[string]*node{