mirror of
https://github.com/chai2010/advanced-go-programming-book.git
synced 2025-05-24 20:52:22 +00:00
ch1-03: 修复代码错误
This commit is contained in:
parent
5008fb6ab3
commit
23fdfa8cd8
@ -298,7 +298,7 @@ func str2bytes(s string) []byte {
|
|||||||
```go
|
```go
|
||||||
func bytes2str(s []byte) (p string) {
|
func bytes2str(s []byte) (p string) {
|
||||||
data := make([]byte, len(s))
|
data := make([]byte, len(s))
|
||||||
for i, c := s {
|
for i, c := range s {
|
||||||
data[i] = c
|
data[i] = c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user