Golang
dly667
这个作者很懒,什么都没留下…
展开
-
Go Micro开发流程
启动顺序 consul agent -dev micro web micro api --namespace=com.hgmall.api go run com.hgmalls.api/myprojectt/main.go原创 2018-10-08 13:40:11 · 557 阅读 · 0 评论 -
golang 笔记
快速读取文件 fi, err := os.Open(path) if err != nil { panic(err) } defer fi.Close() fd, err := ioutil.ReadAll(fi) //[]byte os 包的用法 os.Getwd() 当前文件路径的字符串和一个err信息 os.Chdir() 将当前文件路径改变为目标路径(非真实改变) os.G...原创 2018-12-05 13:17:49 · 130 阅读 · 0 评论 -
Golang struct动态调用其方法和属性
package main import ( "fmt" "reflect" ) type MyStr1 struct { } func (y *MyStr1) Test1() { fmt.Println("Test1 called") } type MyStr2 struct { } func (y *MyStr2) Test2(i int, oo string) { fmt.P...原创 2019-04-11 15:24:53 · 5253 阅读 · 0 评论