Changed generic type constraint

This commit is contained in:
Eduard Urbach 2023-07-18 17:14:34 +02:00
parent c26f7d6671
commit 85256417fd
Signed by: eduard
GPG key ID: 49226B848C78F6C8
4 changed files with 7 additions and 11 deletions

View file

@ -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]{}
}