
Golang
dly667
这个作者很懒,什么都没留下…
展开
-
Go Micro开发流程
启动顺序consul agent -devmicro webmicro api --namespace=com.hgmall.apigo run com.hgmalls.api/myprojectt/main.go原创 2018-10-08 13:40:11 · 590 阅读 · 0 评论 -
golang 笔记
快速读取文件fi, err := os.Open(path)if err != nil { panic(err)}defer fi.Close()fd, err := ioutil.ReadAll(fi) //[]byteos 包的用法os.Getwd() 当前文件路径的字符串和一个err信息os.Chdir() 将当前文件路径改变为目标路径(非真实改变)os.G...原创 2018-12-05 13:17:49 · 156 阅读 · 0 评论 -
Golang struct动态调用其方法和属性
package mainimport ( "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 · 5373 阅读 · 0 评论