How to check for nil pointer properly?

1 - May be try {{ if eq $m "nil" }}

2 - Not sure if the {{ return }} command is legit without return variable. And in any case {{ return $myvar }} is evaluate ONCE in the partial and is NOT affected by the go template logic.

See : Returning values from partials

1 Like