在bytes_test.go中我看到:
a := Split([]byte(tt.s), []byte(tt.sep), tt.n)
Run Code Online (Sandbox Code Playgroud)
其中 tt.s 和 tt.sep 是字符串。但是当我尝试做的时候
a := bytes.Split([]byte("test"), []byte("e"), 0)
Run Code Online (Sandbox Code Playgroud)
我得到:
cannot convert "test" (type ideal string) to type []uint8 in conversion
cannot convert "e" (type ideal string) to type []uint8 in conversion
Run Code Online (Sandbox Code Playgroud)