Skip to content

Instantly share code, notes, and snippets.

@RadioactiveMouse
Created October 25, 2012 11:50
Show Gist options
  • Save RadioactiveMouse/3952170 to your computer and use it in GitHub Desktop.
Save RadioactiveMouse/3952170 to your computer and use it in GitHub Desktop.
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