refactor: slice exercises 22 and 24

This commit is contained in:
Inanc Gumus
2019-08-22 20:55:47 +03:00
parent 792a7a75d4
commit 08d881a3d0
6 changed files with 126 additions and 73 deletions

View File

@ -12,10 +12,6 @@ import (
)
func main() {
s.PrintBacking = true
s.MaxPerLine = 10
s.Width = 60
// ########################################################
//
// #1: Create a string slice: `names` with a length and
@ -115,3 +111,15 @@ func main() {
s.Show("6th step", clone, sliced)
}
//
// Don't mind about this function.
//
// For printing the slices: You can either use the
// prettyslice package or `fmt.Printf`.
//
func init() {
s.PrintBacking = true // prints the backing array
s.MaxPerLine = 10 // prints 10 slice elements per line
s.Width = 60 // prints 60 character per line
}