Skip to content

Files

Failed to load latest commit information.

Latest commit

 Cannot retrieve latest commit at this time.

History

History

interface

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

interface

思考题

package main

import "log"

type testStruct struct{}

func NilOrNot(v interface{}) bool {
	return v == nil
}

func main() {
	var s *testStruct

	log.Println("s==nil: ", s == nil)
	log.Println("NilOrNot(interface{}): ", NilOrNot((s)))
}

问题: 答案是什么?