Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
admpub committed Aug 23, 2014
1 parent f6d526d commit 234d364
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ golang:优化读取struct内的tag值(只解析一次,以后都从缓存
```
package main
import (
"fmt"
"reflect"
"github.com/coscms/tagfast"
)
Expand All @@ -21,7 +22,16 @@ func main(){
m:=Coscms{}
t := reflect.TypeOf(m)
for i := 0; i < t.NumField(); i++ {
widget:=tagfast.Tag(m,i,"form_widget")
fmt.Println("widget:",widget)
valid:=tagfast.Tag(m,i,"valid")
fmt.Println("valid:",valid)
xorm:=tagfast.Tag(m,i,"xorm")
fmt.Println("xorm:",xorm)
}
}
```

0 comments on commit 234d364

Please sign in to comment.