运行godoc -http :8080
,即可在localhost:8080查看文档
queue_test.go:
func ExampleQueue_Push() {
q := Queue{}
q.Push(1)
fmt.Println(q.Pop())
// Output:
// 1
}
为自己的包写函数示例
运行godoc -http :8080
,即可在localhost:8080查看文档
queue_test.go:
func ExampleQueue_Push() {
q := Queue{}
q.Push(1)
fmt.Println(q.Pop())
// Output:
// 1
}
为自己的包写函数示例