01、使用...打散参数

 1 package main
 2 
 3 import (
 4     "fmt"
 5 )
 6 
 7 func main() {
 8     s := []byte("hello ")//强转
 9     s = append(s, "world"...)//向byte切片追加,...表示将字符串打散成byte切片
10     fmt.Println(s)
11 }

 

posted on 2020-05-04 11:30  TBBS  阅读(137)  评论(0编辑  收藏  举报