title: How in Go lang function returning multiple value can be passed to other function with a variadic parameter
body: <p>I am new to go programming,</p>
  
  <p>Assume this code, where in function <code>fmt.Printf()</code> passing two different values</p>
  
  <pre><code>package main
  
  import "fmt"
  
  func main() {
     var a int = 150
     var b int = 130
     var ret1, ret2 int
     ret1, ret2 = max(a, b)
     fmt.Printf( "Max val: %d Min val: %d\n", ret1, ret2 )
  }
  
  func max(num1, num2 int) (int,int) {
     if (num1 &gt; num2) {
        return num1, num2
     } else {
        return num2, num1
     }
  }
  </code></pre>
  
  <p>Instead of passing ret1, ret2 in <code>fmt.Printf( "Max val: %d Min val: %d\n", ret1, ret2 )</code> is there any way, I can directly pass <code>max(a, b)</code> in <code>fmt.Printf()</code> like</p>
  
  <pre><code>fmt.Printf( "Max val: %d Min val: %d\n", max(a, b))
  </code></pre>
  
  <p>I had tried it, it is giving error </p>
  
  <blockquote>
    <p>multiple-value max() in single-value context</p>
  </blockquote>
  
  <p>As it seems, returning two different values not a tuple, is my concept for this returning is wrong or I am doing it wrong.</p>
  
  <p><strong>Is there any method to pass function with multiple return directly to function require variable number of values</strong></p>
  
  <p>TIA</p>