Changed generic type constraint
This commit is contained in:
parent
c26f7d6671
commit
85256417fd
4 changed files with 7 additions and 11 deletions
|
@ -3,7 +3,7 @@ package router
|
|||
import "os"
|
||||
|
||||
// Router is a high-performance router.
|
||||
type Router[T comparable] struct {
|
||||
type Router[T any] struct {
|
||||
get Tree[T]
|
||||
post Tree[T]
|
||||
delete Tree[T]
|
||||
|
@ -16,7 +16,7 @@ type Router[T comparable] struct {
|
|||
}
|
||||
|
||||
// New creates a new router containing trees for every HTTP method.
|
||||
func New[T comparable]() *Router[T] {
|
||||
func New[T any]() *Router[T] {
|
||||
return &Router[T]{}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue