In Go, is it idiomatic to check for nil and return an error if a parameter is nil?
Should pointer method receivers ever include nil checks?
I've seen a lot of code in other languages where people applying defensive programming also checked for nulls and threw an exception when a null was passed in. I am wondering if the Go-equivalent, checking for nil and returning an error, is idiomatic in Go. Say some function returns nil for some reason and you pass in nil into another function. This function doesn't handle nils and somewhere down the stack inside of the function a "kaboom" occurs, leaving the caller wondering whether the error is inside of the abstraction or in his calling code.