package main
import (
"fmt"
"github.com/samber/do/v2"
typeStr "github.com/samber/go-type-to-string" // v1.3.0
)
func main() {
i := do.New()
fmt.Println(typeStr.GetType[[1]int]()) // []int
fmt.Println(do.NameOf[[1]int]()) // []int
// but
fmt.Println(reflect.TypeOf([1]int{1}).String()) // [1]int
do.ProvideValue(i, [1]int{})
fmt.Println(do.InvokeAs[[3]int](i)) // could not find service satisfying interface `[]int`, available services: `[]int`
fmt.Println(do.InvokeAs[[]int](i)) // could not find service satisfying interface `[]int`, available services: `[]int`
fmt.Println(do.InvokeAs[[]int](i)) // could not find service satisfying interface `[]int`, available services: `[]int`
do.ProvideValue(i, []int{}) // panic: DI: service `[]int` has already been declared
}