Created
February 10, 2017 01:53
-
-
Save aeppert/24fd926314466f71fc879e2deaefb0ce to your computer and use it in GitHub Desktop.
Golang move file using os.Rename method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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