Skip to content

Instantly share code, notes, and snippets.

@hoelzro
Created March 13, 2020 14:10
Show Gist options
  • Save hoelzro/813163d3ae4f08cc5915bb2c8aa385f8 to your computer and use it in GitHub Desktop.
Save hoelzro/813163d3ae4f08cc5915bb2c8aa385f8 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
)
func main() {
sliceOne := make([]byte, 10)
sliceTwo := sliceOne[0:5]
fmt.Println(sliceOne)
fmt.Println(len(sliceOne))
fmt.Println(cap(sliceOne))
fmt.Println("-----")
fmt.Println(sliceTwo[0:6])
fmt.Println(len(sliceTwo))
fmt.Println(cap(sliceTwo))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment