title: Designing Go packages: when I should define methods on types?
body: <p>Suppose that I have a type <code>type T int</code>and I want to define a logic to operate on this type.</p>
  
  <p>What abstraction should I use and When ?</p>
  
  <ul>
  <li><p>Defining a <strong>method</strong> on that type:</p>
  
  <pre><code> func (T t) someLogic() {
   // ...
   } 
  </code></pre></li>
  <li><p>Defining  a <strong>function</strong>: </p>
  
  <pre><code> func somelogic(T t) {
   // ...
   }
  </code></pre></li>
  </ul>