You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import (
"fmt""github.com/samber/do/v2"
typeStr "github.com/samber/go-type-to-string"// v1.3.0
)
funcmain() {
i:=do.New()
fmt.Println(typeStr.GetType[[1]int]()) // []intfmt.Println(do.NameOf[[1]int]()) // []int// butfmt.Println(reflect.TypeOf([1]int{1}).String()) // [1]intdo.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
}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: