golang中的os.Chdir()无法正常工作。
package main
import (
"fmt"
"os"
)
func main() {
command := "cd C:\\"
if err := os.Chdir(command[3:]); err != nil {
fmt.Println("Error:\tCould not move into the directory (%s)\n")
}
}
输出:
Error: Could not move into the directory
我做错了什么还是错过了什么?