Created
March 12, 2018 12:58
-
-
Save kurotych/955e2475d9cc2015ca1209797aa000d1 to your computer and use it in GitHub Desktop.
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
func byteStringToBytes(s *string) []byte { | |
*s = (*s)[1:len(*s) - 1] | |
split := strings.Split(*s, ",") | |
res := make([]byte, len(split)) | |
for i, el := range split { | |
r , _ := strconv.Atoi(el) | |
res[i] = byte(r) | |
} | |
return res | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment