update book code

This commit is contained in:
Unknwon
2015-03-03 12:25:25 -05:00
parent b8c82ba4e5
commit eab1d98ba8
465 changed files with 15392 additions and 1572 deletions

View File

@@ -0,0 +1,29 @@
// main_stack.go
package main
import (
"fmt"
"./stack/stack"
)
var st1 stack.Stack
func main() {
st1.Push("Brown")
st1.Push(3.14)
st1.Push(100)
st1.Push([]string{"Java", "C++", "Python", "C#", "Ruby"})
for {
item, err := st1.Pop()
if err != nil {
break
}
fmt.Println(item)
}
}
/* Output:
[Java C++ Python C# Ruby]
100
3.14
Brown
*/