A type assertion interface value నుండి concrete type ను extract చేస్తుంది, మరియు type switch interface యొక్క underlying type ఆధారంగా branch చేస్తుంది. Interface నుండి (ముఖ్యంగా empty interface / any నుండి) నిర్దిష్ట type information ను recover చేయడానికి ఇవి ఉపయోగించబడతాయి.
Type assertion — concrete type ను extract చేయడం
i {} =
s := i.()
fmt.Println(s)
n := i.()
