Created
June 30, 2015 04:01
-
-
Save hackintoshrao/3bfec9fd7f042ab9d558 to your computer and use it in GitHub Desktop.
functions containing Marshal pf Map and Struct
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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