golang "[]uint8" to string

关于Uinit8和Byte:

The Go Programming Language Specification Numeric types

uint8 the set of all unsigned 8-bit integers (0 to 255)

byte alias for uint8

将[]uinit8转换为string:

func B2S(bs []int8) string {
  ba := []byte{}
  for _, b := range bs {
    ba = append(ba, byte(b))
  }
  return string(ba)
}

参考文章:

https://blog.csdn.net/pingD/article/details/76588648

原文地址:https://www.cnblogs.com/yzhch/p/8743688.html