Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Struct Mapping
package main
import "fmt"
import "time"
type Metric struct {
Name string
DateTime time.Time
Value int
}
func main() {
MetricList := make(map[int]Metric)
MetricList[0] = Metric{"Tom",time.Now(),24}
MetricList[1] = Metric{"Laura",time.Now(),25}
fmt.Printf("%+v \n", MetricList)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.