30 lines
454 B
Go
30 lines
454 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
func main() {
|
|
fmt.Println("vim-go")
|
|
f, err := os.Create("./lsdkj/lfksdjf")
|
|
if err != nil {
|
|
log.Panicln(err)
|
|
}
|
|
err = f.Close()
|
|
if err != nil {
|
|
log.Panicln(err)
|
|
}
|
|
log.Println("created")
|
|
/*
|
|
data, err := os.ReadFile("./foo/notexist")
|
|
if err == nil {
|
|
fmt.Println(data)
|
|
} else if errors.Is(err, os.ErrNotExist) {
|
|
fmt.Printf("not exist: %v\n", err)
|
|
}
|
|
fmt.Printf("err: %v\n", err)
|
|
*/
|
|
}
|