Skip to content

Instantly share code, notes, and snippets.

@hackintoshrao
Created June 30, 2015 04:01
Show Gist options
  • Save hackintoshrao/3bfec9fd7f042ab9d558 to your computer and use it in GitHub Desktop.
Save hackintoshrao/3bfec9fd7f042ab9d558 to your computer and use it in GitHub Desktop.
functions containing Marshal pf Map and Struct
package bench2
import (
"encoding/json"
)
func MarshalMap() {
m := map[int]int{0: 0, 1: 1}
json.Marshal(m)
}
func MarshalStruct() {
m := struct{ a, b int }{0, 1}
json.Marshal(m)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment