Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

20 строки
511 B

  1. // Copyright 2018 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. package unix_test
  5. // stringsFromByteSlice converts a sequence of attributes to a []string.
  6. // On Darwin, each entry is a NULL-terminated string.
  7. func stringsFromByteSlice(buf []byte) []string {
  8. var result []string
  9. off := 0
  10. for i, b := range buf {
  11. if b == 0 {
  12. result = append(result, string(buf[off:i]))
  13. off = i + 1
  14. }
  15. }
  16. return result
  17. }