Quiz: Deduce the Outputs
In this lesson your concepts will be evaluated through a quiz.
We'll cover the following...
We'll cover the following...
Choose one correct answer
1.
What’s wrong with the following code?
package main
import "container/list"
func (p *list.List) Iter() {
// ...
}
func main() {
lst := new(list.List)
for _ = range lst.Iter() {
}
}
A.
lst
is not a pointer type object
B.
Cannot define new methods on non-local type list.List
C.
lst.Iter
undefined (type *list.List
has no field or method Iter
)
D.
Both B and C
E.
All of the above
1 / 6
We hope that you ...