Skip to content

Instantly share code, notes, and snippets.

@aeppert
Created February 10, 2017 01:53
Show Gist options
  • Save aeppert/24fd926314466f71fc879e2deaefb0ce to your computer and use it in GitHub Desktop.
Save aeppert/24fd926314466f71fc879e2deaefb0ce to your computer and use it in GitHub Desktop.
Golang move file using os.Rename method
package main
import (
"fmt"
"os"
)
func main() {
err := os.Rename("/dir1/file1", "/dir2/file2")
if err != nil {
fmt.Println(err)
return
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment