摘要:
# golang:latest镜像 FROM ee23292e2826 # 作者 MAINTAINER dechao@qq.com # 添加Golang环境变量 ENV GOPROXY https://goproxy.cn,direct ENV GO111MODULE on ENV GOROOT / 阅读全文
摘要:
main.go package main import ( "bufio" "encoding/json" "fmt" "io" "io/ioutil" "net/http" "os" "regexp" "strings" "sync" ) //读取key=value类型的配置文件 func Ini 阅读全文
摘要:
https://www.cnblogs.com/chnmig/p/11806609.html 阅读全文
摘要:
main.go package main func main() { server := NewServer("127.0.0.1", 8888) server.Start() } server.go package main import ( "fmt" "io" "net" "sync" "ti 阅读全文
摘要:
channel1.go package main import "fmt" func main() { //定义一个channel c := make(chan int) go func() { defer fmt.Println("goroutine结束") fmt.Println("gorout 阅读全文
摘要:
goroutine.go package main import ( "fmt" "time" ) //子goroutine func newTask() { i := 0 for { i++ fmt.Printf("new Goroutine : i = %d\n", i) time.Sleep( 阅读全文
摘要:
pair1.go package main import "fmt" func main() { var a string //pair<statictype:string, value:"aceld"> a = "aceld" //pair<type:string, value:"aceld"> 阅读全文
摘要:
struct.go package main import "fmt" //声明一种行的数据类型 myint, 是int的一个别名 type myint int //定义一个结构体 type Book struct { title string auth string } func changeBo 阅读全文
摘要:
map1.go package main import "fmt" func main() { // > 第一种声明方式 //声明myMap1是一种map类型 key是string, value是string var myMap1 map[string]string if myMap1 == nil 阅读全文
摘要:
数组 array.go package main import "fmt" func printArray(myArray [4]int) { //值拷贝 for index, value := range myArray { fmt.Println("index = ", index, ", va 阅读全文