3
Jak wyczyścić plasterek w Go?
Jaki jest właściwy sposób na usunięcie kawałka w Go? Oto, co znalazłem na forach go : // test.go package main import ( "fmt" ) func main() { letters := []string{"a", "b", "c", "d"} fmt.Println(cap(letters)) fmt.Println(len(letters)) // clear the slice letters = letters[:0] fmt.Println(cap(letters)) fmt.Println(len(letters)) } Czy to jest poprawne? Aby …