title: Log multiple returned values in Go
body: <p>Is there an idiomatic way to log result of a function returning multiple values? This won't compile:</p>
  
  <pre><code>import "log"
  func returnPair() (int,int) {
      return 42, 24
  }
  func main() {
      log.Printf("Returned %v", returnPair())
  }
  
  prog.go:7: multiple-value returnPair() in single-value context
  </code></pre>
  
  <p>UPD summary (special thanks to @rvignacio):</p>
  
  <p>This is a peculiarity in Go syntax:</p>
  
  <pre><code>func eat(args ...interface{}) {}
  
  func eatWithSpice(spice string, args ...interface{}) {}
  
  func main() {
      eat(returnPair()) // this works
      eatWithSpice("pepper", returnPair()) // this does not
  }
  </code></pre>
  
  <p><em>As a special case, if the return values of a function or method g are equal in number and individually assignable to the parameters of another function or method f, then the call f(g(parameters_of_g)) will invoke f after binding the return values of g to the parameters of f in order. The call of f must contain no parameters other than the call of g, and g must have at least one return value. If f has a final ... parameter, it is assigned the return values of g that remain after assignment of regular parameters.</em> (<a href="http://golang.org/ref/spec#Calls" rel="nofollow">http://golang.org/ref/spec#Calls</a>)</p>