mirror of
https://github.com/golang/go
synced 2024-11-19 06:14:39 -07:00
16 lines
298 B
Go
16 lines
298 B
Go
|
package a
|
||
|
|
||
|
import "fmt"
|
||
|
|
||
|
func TypeStuff() { //@Stuff
|
||
|
var x string
|
||
|
|
||
|
switch y := interface{}(x).(type) { //@mark(switchY, "y"),mark(switchStringY,"y"),godef("y", switchY)
|
||
|
case int:
|
||
|
fmt.Printf("%v", y) //@godef("y", switchY)
|
||
|
case string:
|
||
|
fmt.Printf("%v", y) //@godef("y", switchStringY)
|
||
|
}
|
||
|
|
||
|
}
|