Created
October 4, 2018 23:54
-
-
Save ariesmcrae/767fba6a875cca225f8fcb368347ebfc to your computer and use it in GitHub Desktop.
secret: go json struct unmarshall util
This file contains hidden or 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 util | |
import ( | |
"encoding/json" | |
) | |
func Unmarshall(jsonPayload string, v interface{}) error { | |
return json.Unmarshal([]byte(jsonPayload), v) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment