1 2 3 4 5 6 7 8 9 10 11 12 13 14
| package main import ( "fmt" "os" )
func main() { dir := "new" if err := os.Mkdir(dir, 0755); os.IsExist(err) { fmt.Println("The directory named", dir, "exists") } else { fmt.Println("The directory named", dir, "does not exist") } }
|