title: Type cast vs type assertion on concrete struct?
body: <p>I am new to golang, so appologize if this question is too naive. Looked around, but could not find answer to my basic question.</p>
  
  <p>Lets say I have a concrete struct and methods as shown below.</p>
  
  <pre><code> type MyData struct{
       field1 string
       field2 int 
       }
  
  func(a MyData) OperatorOnString() string{
    return a.field1.(string)
  }
  
  func(a MyData) OperatorOnInt() int{
    return a.field2.(int)
  }
  </code></pre>
  
  <p>My question is, can I type cast and return rather than performing assertion? From what I have learned so far is that, assertion is used on data of type interface. But in this case I have concrete type. Should I still use assertion or I can do something like <code>return int(a.field2)</code>. I know this example is trivial, but the point that I am confused is when to use between the two conversion types. Or is there some golang idiomaticity involved here? </p>
  
  <p>Thanks</p>