Application
Create new folder named src. In src folder, create new folder named data. In src folder, create new file named main.go as below:
package main
import (
"fmt"
"os"
)
func main() {
file, err := os.Create("data/a.txt")
if err != nil {
fmt.Println(err)
} else {
fmt.Println(file)
fmt.Println("Done")
}
}
Output
Open Terminal windows in Visual Studio Code and run command line: go run main.go
&{0xc00007c780}
Done