title: Golang Command-Line String Flag
body: <p>I'm trying to get command line flags working with strings in golang. Here is my main/main.go file:</p>
  
  <pre><code>package main
  
  import (
      "flag"
      "log"
  )
  
  func main() {
      flagString := flag.String("string", "foo", "Enter this string and have it printed back out.")
  
      log.Println("You entered ", *flagString)
  
   }
  </code></pre>
  
  <p>This simply takes the flag from the command line and prints it out, with default value "foo".</p>
  
  <p>I enter the following into the command prompt after building the project, trying to make it print out bar:</p>
  
  <pre><code>&gt; main -string=bar
  
  (log time+date) You entered foo
  
  &gt; main -string="bar"
  
  (log time+date) You entered foo
  </code></pre>
  
  <p>Is there something wrong with my code or am I entering it into the command prompt incorrectly?</p>
  
  <p>By the way, I am running Windows 10.</p>