title: How do you make a function accept multiple types?
body: <p>I am having a function like this:</p>
  <pre><code>package main
  import &quot;flag&quot;
  import &quot;fmt&quot;
  
  func print_out_type(x anything) string {
      switch v := x.(type) {
          case string:
               return &quot;A string&quot;
          case int32:
               return &quot;An Integer&quot;
          default:
               return &quot;A default&quot;
      }
  }
  
  func main() {
      wordPtr := flag.String(&quot;argument1&quot;, &quot;foo&quot;, &quot;a String&quot;)
      numPtr := flag.Int(&quot;argument2&quot;, 42, &quot;an Integer&quot;)
      flag.Parse()
      fmt.Println(&quot;word: &quot;, *wordPtr)
      fmt.Println(&quot;number: &quot;, *numPtr)
  }
  </code></pre>
  <p>I am trying to return different types of strings based on the type. I am just stuck at the point of how do I write a function that accepts arguments of different types.</p>