Created
March 30, 2020 14:58
-
-
Save psanzay/cabf9ece8b8c85972a9bb31edfa2adb4 to your computer and use it in GitHub Desktop.
deserialize data
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
in, err := ioutil.ReadFile("persons") | |
if err != nil { | |
log.Fatalln("Error reading file:", err) | |
} | |
person := &pb.Person{} | |
if err := proto.Unmarshal(in, person); err != nil { | |
log.Fatalln("Failed to parse person list:", err) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment