Create an empty file


Example

package main
 
import (
	"log"
	"os"
)
 
func main() {
	emptyFile, err := os.Create("empty.txt")
	if err != nil {
		log.Fatal(err)
	}
	log.Println(emptyFile)
	emptyFile.Close()
}

Output

2018/08/11 15:46:04 &{0xc042060780}
Most Helpful This Week