In go you can have several returns like:
func getAdressParts() (plz *string, street *string) {
return nil, nil
}
func main() {
//if getAdressParts() == nil, nill {
// println(true)
//} else {
// println(false)
//}
// As already suggested the answer is:
if plz, street := getAdressParts(); plz == nil && street == nil {
println("Hurra")
} else {
println("nope")
}
}
is there any way to check both inline for nil like:
if getAdressParts() == nil, nil {
...
}
you can play with example here: https://play.golang.org/p/xbHCxl_AJyw