diff --git a/golangr/renamer/go.mod b/golangr/renamer/go.mod new file mode 100644 index 0000000..b1c7d3b --- /dev/null +++ b/golangr/renamer/go.mod @@ -0,0 +1,3 @@ +module renamer + +go 1.22.0 diff --git a/golangr/renamer/main.go b/golangr/renamer/main.go new file mode 100644 index 0000000..e40379f --- /dev/null +++ b/golangr/renamer/main.go @@ -0,0 +1,21 @@ +package main + +import ( + "fmt" + "os" +) + +var src string +var dst string + +func main() { + if len(os.Args) != 3 { + fmt.Println("Usage: ./renamer oldfile newfile") + os.Exit(1) + } + src = os.Args[1] + dst = os.Args[2] + + os.Rename(src, dst) + +}