title: Validate if struct variable is empty or not
body: <p>First of all, look at the following code snippet:</p>
  
  <pre><code>package main
  
  import (
      "fmt"
  )
  
  func main() {
  
      var para1 struct {
          email, addr string
      }
  
      para1.email = "test@test.com"
  
      if para1 != nil {
          fmt.Println(para1)
      }
  
  }
  </code></pre>
  
  <p>When I compile this code, I've got the compiler error: </p>
  
  <pre><code>./struct_func.go:15: cannot convert nil to type struct { email string; addr string }
  </code></pre>
  
  <p>How can I validate if my struct variable, if nil or not? Or I have to validate of property like </p>
  
  <pre><code>if para1.email != nil {
      fmt.Println(para1)
  }
  </code></pre>