Quiz · Interfaces · lesson 8 of 10
Quiz — a nil pointer in a type switch
What does the program print?
package main
import "fmt"
func main() {
var p *int
var v any = p
switch x := v.(type) {
case nil, *int:
fmt.Println(x == nil)
}
}Subscribe to take the course
The course is free. Sign in with Telegram and subscribe to the channel to open every lesson.