Skip to content

Instantly share code, notes, and snippets.

@kurotych
Created March 12, 2018 12:58
Show Gist options
  • Save kurotych/955e2475d9cc2015ca1209797aa000d1 to your computer and use it in GitHub Desktop.
Save kurotych/955e2475d9cc2015ca1209797aa000d1 to your computer and use it in GitHub Desktop.
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