摘要: # golang:latest镜像 FROM ee23292e2826 # 作者 MAINTAINER dechao@qq.com # 添加Golang环境变量 ENV GOPROXY https://goproxy.cn,direct ENV GO111MODULE on ENV GOROOT / 阅读全文
posted @ 2021-07-12 08:09 得超 阅读(141) 评论(0) 推荐(0) 编辑
摘要: main.go package main import ( "bufio" "encoding/json" "fmt" "io" "io/ioutil" "net/http" "os" "regexp" "strings" "sync" ) //读取key=value类型的配置文件 func Ini 阅读全文
posted @ 2021-07-04 08:44 得超 阅读(77) 评论(0) 推荐(0) 编辑
摘要: https://www.cnblogs.com/chnmig/p/11806609.html 阅读全文
posted @ 2021-06-29 12:32 得超 阅读(23) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2021-06-27 18:13 得超 阅读(385) 评论(0) 推荐(0) 编辑
摘要: channel1.go package main import "fmt" func main() { //定义一个channel c := make(chan int) go func() { defer fmt.Println("goroutine结束") fmt.Println("gorout 阅读全文
posted @ 2021-06-27 17:56 得超 阅读(53) 评论(0) 推荐(0) 编辑
摘要: goroutine.go package main import ( "fmt" "time" ) //子goroutine func newTask() { i := 0 for { i++ fmt.Printf("new Goroutine : i = %d\n", i) time.Sleep( 阅读全文
posted @ 2021-06-27 17:54 得超 阅读(54) 评论(0) 推荐(0) 编辑
摘要: pair1.go package main import "fmt" func main() { var a string //pair<statictype:string, value:"aceld"> a = "aceld" //pair<type:string, value:"aceld"> 阅读全文
posted @ 2021-06-27 17:53 得超 阅读(97) 评论(0) 推荐(0) 编辑
摘要: struct.go package main import "fmt" //声明一种行的数据类型 myint, 是int的一个别名 type myint int //定义一个结构体 type Book struct { title string auth string } func changeBo 阅读全文
posted @ 2021-06-27 17:50 得超 阅读(98) 评论(0) 推荐(0) 编辑
摘要: map1.go package main import "fmt" func main() { // > 第一种声明方式 //声明myMap1是一种map类型 key是string, value是string var myMap1 map[string]string if myMap1 == nil 阅读全文
posted @ 2021-06-27 17:47 得超 阅读(38) 评论(0) 推荐(0) 编辑
摘要: 数组 array.go package main import "fmt" func printArray(myArray [4]int) { //值拷贝 for index, value := range myArray { fmt.Println("index = ", index, ", va 阅读全文
posted @ 2021-06-27 17:45 得超 阅读(45) 评论(0) 推荐(0) 编辑