Easy Go Programming Setup for Windows
Dec 23, 2014
I’ve had to do this more than once recently, so I figured I’d document the simple steps for setting up the Go programming language on Windows. Mo ...……
switch还可以用于判断变量类型。使用方式为T.(type),即在变量后加上.(type)。见代码:
package main
import (
amp;quot;fmtamp;quot;
)
func main() {
var a interface{}
a = amp;quot;abcamp;quot;
...……
产看go的环境
go env
C:\Users\thinkamp;amp;gt;go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\think\AppData\Local\go-build
set GOENV=C:\Users\think\AppData\Roaming\go\env
set G ...……
一、导入库: go get github.com/demdxx/gocast
二、测试代码:
// main.go
package main
import (
amp;quot;fmtamp;quot;
amp;quot;reflectamp;quot;
amp;quot;github.com/demdxx/gocastamp;quo ...……