add single_file_tests

This commit is contained in:
2020-02-09 23:53:57 +08:00
parent 2bbe3a6575
commit d60039deac
2 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
package main
import (
"fmt"
)
func main() {
var x interface{} = "str"
switch t := x.(type) {
case string:
fmt.Println("String!")
s := x.(string)
fmt.Println("As string: " + s)
default:
fmt.Println("Other: ", t)
}
}