Files
moxa/_test/map29.go
Nicholas Wiersma 8365f687e7 fix: composite map assign (#683)
* fix: composite map assign

* reword comment

Co-authored-by: Marc Vertes <mvertes@free.fr>
2020-06-10 12:29:09 +02:00

27 lines
285 B
Go

package main
import (
"fmt"
"time"
)
type Item struct {
Object interface{}
Expiry time.Duration
}
func main() {
items := map[string]Item{}
items["test"] = Item{
Object: "test",
Expiry: time.Second,
}
item := items["test"]
fmt.Println(item)
}
// Output:
// {test 1s}