whatcanGOwrong
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
func main() {
|
||||
type S struct {
|
||||
F string `species:"gopher" color:"blue"`
|
||||
}
|
||||
|
||||
s := S{}
|
||||
st := reflect.TypeOf(s)
|
||||
field := st.Field(0)
|
||||
fmt.Println(field.Tag.Get("color"), field.Tag.Get("species"))
|
||||
}
|
||||
Reference in New Issue
Block a user