github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/backup/struct58.gno (about) 1 package main 2 3 import ( 4 "fmt" 5 "reflect" 6 ) 7 8 type A struct { 9 Test string `tag:"test"` 10 } 11 12 func main() { 13 a := A{} 14 t := reflect.TypeOf(a) 15 f, ok := t.FieldByName("Test") 16 if !ok { 17 return 18 } 19 20 fmt.Println(f.Tag.Get("tag")) 21 } 22 23 // Output: 24 // test