utilities.go 274 B

12345678910111213141516171819202122
  1. package ansiterm
  2. import (
  3. "strconv"
  4. )
  5. func sliceContains(bytes []byte, b byte) bool {
  6. for _, v := range bytes {
  7. if v == b {
  8. return true
  9. }
  10. }
  11. return false
  12. }
  13. func convertBytesToInteger(bytes []byte) int {
  14. s := string(bytes)
  15. i, _ := strconv.Atoi(s)
  16. return i
  17. }