majianyu
3/13/2018 - 1:04 PM

go_example

package queue

import "fmt"
// 文件以 test.go 结尾
// godoc -http=":3000"
func ExampleQueue_Pop() {
    q := Queue{1}
    q.Push(2)
    q.Push(3)
    fmt.Println(q.Pop())
    fmt.Println(q.Pop())
    fmt.Println(q.IsEmpty())

    fmt.Println(q.Pop())
    fmt.Println(q.IsEmpty())
    // Output:
    // 1
    // 2
    // false
    // 3
    // true
}