title: Global variable inline assignment with combined declaration/assignment operator and another undeclared variable losing scope?
body: <p>This Go program will not compile. It throws the error <code>global_var declared and not used</code></p>
  
  <pre><code>package main
  
  import "log"
  
  var global_var int
  
  func main() {
  
      global_var, new_string := returnTwoVars()
  
      log.Println("new_string: " + new_string)
  }
  
  func returnTwoVars() (int, string) {
      return 1234, "woohoo"
  }
  
  func usesGlobalVar() int {
      return global_var * 2
  }
  </code></pre>
  
  <p>However, when I remove the need for using the <code>:=</code> operator by declaring <code>new_string</code> in the main function and simply using <code>=</code>, the compiler doesn't have a problem with seeing that <code>global_var</code> is declared globally and being used elsewhere in the program. My intuition tells me that it should know that <code>global_var</code> is declared already</p>