[x/blog] g.blog/slices: trivial fix to PtrSubtractOneFromLength example
There should be a := not an = in the body of the function. Another broken example working by accident. R=adg CC=golang-dev https://golang.org/cl/14059044 X-Blog-Commit: 4f303a1af2796bdcdf14fea5d4974f6c3b26c407
This commit is contained in:
Родитель
17bd7046c4
Коммит
1ee6a4863d
|
@ -12,7 +12,7 @@ var buffer [256]byte
|
|||
var slice []byte = buffer[100:150]
|
||||
|
||||
func PtrSubtractOneFromLength(slicePtr *[]byte) {
|
||||
slice = *slicePtr
|
||||
slice := *slicePtr
|
||||
*slicePtr = slice[0 : len(slice)-1]
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче