01 2019 档案

摘要:import ( "fmt" "reflect" ) type Foo struct { FirstName string `tag_name:"tag 1"` LastName string `tag_name:"tag 2"` Age int `tag_name:"tag 3"` } func (f *Foo) reflect... 阅读全文
posted @ 2019-01-31 20:17 hao.ma 阅读(358) 评论(0) 推荐(0)
摘要:A good API provides a good mental model A good API is simple :“Make things as simple as possible, but no simpler.” A good API allows multiple implemen 阅读全文
posted @ 2019-01-11 10:54 hao.ma 阅读(134) 评论(0) 推荐(0)
摘要:package main import ( "fmt" "reflect" ) type Log struct { Path string Level string } func (l *Log) Conversion(i interface{}) { if data, ok := i.(*Log); ok { if data != nil { if len(dat... 阅读全文
posted @ 2019-01-08 20:43 hao.ma 阅读(222) 评论(0) 推荐(0)