摘要: 1、version: 查看golang版本 例:go version 2、run: 编译并运行go程序 例: go run main.go 3、build: 编译go程序,不允许 例:go build main.go4、vet: 静态检查 例:go tool vet . //静态检查当前目录下所有文 阅读全文
posted @ 2018-12-10 16:01 一沐春风 阅读(3235) 评论(0) 推荐(0) 编辑
摘要: docker安装mysql 1、docker pull mysql:5.62、docker images3、docker run -itd -P mysql:5.6 bash4、docker ps -- 查看正在运行的容量,获取容器ID5、docker exec -it $ID bash(进入容器, 阅读全文
posted @ 2018-12-10 15:50 一沐春风 阅读(332) 评论(0) 推荐(0) 编辑
摘要: import ( "github.com/gin-gonic/gin" "net/http" "github.com/sirupsen/logrus" ) // 1、最简单gin func GinSample(){ engine := gin.Default() engine.Any("/",func(context *gin.Context){ ... 阅读全文
posted @ 2018-12-10 15:46 一沐春风 阅读(943) 评论(0) 推荐(0) 编辑
摘要: // 代码转载自https://blog.csdn.net/qq_36183935/article/details/80315808, 向原作者致谢 package main import "fmt" type AVL struct { value int //值 height int //深度 left *AVL //左子树 right *AVL... 阅读全文
posted @ 2018-12-10 15:44 一沐春风 阅读(346) 评论(0) 推荐(0) 编辑
摘要: // 1.多goroutine间通信,channel使用 import ( "fmt" "math/rand" "net" "os" "os/signal" "time" "crypto/sha256" "crypto/sha1" "crypto/md5" "strings" ) func Producer(que... 阅读全文
posted @ 2018-12-10 15:41 一沐春风 阅读(322) 评论(0) 推荐(0) 编辑
摘要: import ( "fmt" "os" "strconv" "time" ) func main() { timeArray := []string{} idx := 0 for _ ,arg := range os.Args{ if idx ==0 { idx = 1 c... 阅读全文
posted @ 2018-12-10 15:39 一沐春风 阅读(922) 评论(0) 推荐(0) 编辑
摘要: 1、运行程序报runnerw.exe: CreateProcess failed with error 216 (no message available) 错误原因:当前包不是main 2、defer用法 阅读全文
posted @ 2018-12-10 15:32 一沐春风 阅读(394) 评论(0) 推荐(0) 编辑
摘要: 基于rancher的docker日志工具 https://github.com/yimuchunfeng2010/DockerLog 阅读全文
posted @ 2018-12-10 15:11 一沐春风 阅读(117) 评论(0) 推荐(0) 编辑