title: How to create new file using go script
body: <p>I am new to go lang. I am able to create a new file from the terminal using go script. like this</p>
  
  <pre><code>go run ../myscript.go &gt; ../filename.txt
  </code></pre>
  
  <p>but I want to create the file from the script.</p>
  
  <pre><code>package main
  
  import "fmt"
  
  func main() {
      fmt.Println("Hello") &gt; filename.txt
  }
  </code></pre>