iteration_list.go 420 B

12345678910111213141516171819
  1. /*
  2. iteration_list.go:12: cannot define new methods on non-local type list.List
  3. iteration_list.go:17: lst.Iter undefined (type *list.List has no field or method Iter)
  4. ---- Build file exited with code 1
  5. */
  6. package main
  7. import "container/list"
  8. // cannot define new methods on non-local type list.List
  9. // List iterator:
  10. func (p *list.List) Iter() {
  11. }
  12. func main() {
  13. lst := new(list.List)
  14. for _ = range lst.Iter() {
  15. }
  16. }