Guest User

Untitled

a guest
Mar 20th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. func byteStringToBytes(s *string) []byte {
  2.  
  3. *s = (*s)[1:len(*s) - 1]
  4.  
  5. split := strings.Split(*s, ",")
  6.  
  7. res := make([]byte, len(split))
  8.  
  9. for i, el := range split {
  10. r , _ := strconv.Atoi(el)
  11. res[i] = byte(r)
  12. }
  13.  
  14. return res
  15. }
Add Comment
Please, Sign In to add comment