Question #224

Author: admin
tags: Go  
package main

import (
	"fmt"
)

type Pet struct {
	Name string
}

func checkIsNil(v any) {
	fmt.Println(v == nil)
}

func main() {
	var x *Pet
	var y *Pet = &Pet{"Alpha"}

	checkIsNil(x)
	checkIsNil(y)
}
What will be printed?
false, false
false, true
true, false
true, true
Under the covers, interfaces are implemented as two elements, a type T and a value V.
An interface value is nil only if the V and T are both unset, (T=nil, V is not set).
Rate the difficulty of the question:
easyhard