tag assert

標籤
貢獻1
32
06:01 AM · Nov 21 ,2025

@assert / 博客 RSS 訂閱

flc1125 - Go:一種很“新”的類型斷言

分享組件:go-kratos-ecosystem/components 注:該功能計劃在 v2.11.0 版本中發佈。 原文:https://flc.io/go-is-type/ 引言 我們在早期使用 Go 做類型斷言的時候,大多是這麼用: var v interface{} v = 10 if _, ok := v.(int); ok { fmt.Println("v is i

assert , 泛型 , 類型檢測 , go

收藏 評論