发表于 2024年6月18日1年前 type fn func(ctx context.Context) []string func test(ctx context.Context) []string { return []string{"1"} } func main() { _, ok := test.(fn) // 报错了 fmt.Println(ok) }