github.com/gnolang/gno@v0.0.0-20240520182011-228e9d0192ce/gnovm/tests/files/map29_native.gno (about) 1 package main 2 3 import ( 4 "fmt" 5 "time" 6 ) 7 8 type Item struct { 9 Object interface{} 10 Expiry time.Duration 11 } 12 13 func main() { 14 items := map[string]Item{} 15 16 items["test"] = Item{ 17 Object: "test", 18 Expiry: time.Second, 19 } 20 21 item := items["test"] 22 fmt.Println(item) 23 } 24 25 // Output: 26 // {test 1s}