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) }