예제 #1
0
파일: hello.go 프로젝트: bsdelf/research
// enter
func main() {
	f := addhold(1)
	fmt.Println(f(1))
	fmt.Println(f(20))
	fmt.Println(f(300))

	list := &StudentList{"class1", []string{"shen", "cai"}}

	list.AppendStudent("yu")
	fmt.Println(list.StudentName)

	list.AppendStudent("wang")
	fmt.Println(list.StudentName)

	list.EraseStudent(list.CountStudent() - 1)
	fmt.Println(list.StudentName)

	list.EraseStudent(list.CountStudent() - 1)
	fmt.Println(list.StudentName)

	list.EraseStudent(list.CountStudent() - 1)
	fmt.Println(list.StudentName)

	list.EraseStudent(0)
	fmt.Println(list.StudentName)

	fmt.Printf("len: %d\n", len(list.StudentName))
	fmt.Printf("cap: %d\n", cap(list.StudentName))

	isAbsList(list)
	isAbsList(FooList{})

	var vec vector.IntVector = []int{1, 2, 3, 4}
	vec.Insert(0, 10)
	fmt.Println(vec)
}