title: How to write a directory with a file in golang?
body: <p>Right now, I am trying to use os.Create but it gives me an error while specifying the path of the file. I have to upload my file from HTML to my file system in a specific directory.</p>
  
  <pre><code>file,err:= c.FormFile("file")
  if err!=nil{
      checkErr(err)
  }
  src, err := file.Open()
  if err!=nil{
      checkErr(err)
  }
  defer src.Close()
  
  abs,err :=filepath.Abs("/dir1/dir2/")
  if err!=nil{
      checkErr(err)
  }
  
  dst,err := os.Create(abs+"/"+file.Filename)
  if err !=nil{
      checkErr(err)
  }
  defer dst.Close()
  if _,err = io.Copy(dst,src); err!=nil{
      checkErr(err)
  }
  </code></pre>
  
  <p>I have to upload the file to dir2. Please help me out. Thank you.</p>