Commits

Miki Tebeka committed 313f2e1

Print right

Comments (0)

Files changed (1)

 }
 
 func (stack *Stack) String() string {
-	return fmt.Sprintf("%v", stack.items)
+	return fmt.Sprintf("%v", stack.items[:stack.count])
 }
 
 func main() {
 	s.Push(2)
 	fmt.Println(s)
 	i, ok := s.Pop()
+	fmt.Println(s)
 	fmt.Println(i, ok)
 	i, ok = s.Pop()
+	fmt.Println(s)
 	fmt.Println(i, ok)
 	i, ok = s.Pop()
+	fmt.Println(s)
 	fmt.Println(i, ok)
 }