fast-replace/go-fast-replace/cmd/corpus/main.go

25 lines
379 B
Go
Raw Normal View History

2023-12-30 21:35:09 +00:00
package main
import (
"fmt"
"log"
"os"
"internal/corpus"
)
func main() {
fmt.Println("Creating corpus...")
f, err := os.OpenFile("./csv/corpus.csv", os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0755)
if err != nil {
log.Fatal(err)
}
defer f.Close()
lines := corpus.MakeCorpus()
// Write to file
for _, line := range lines {
f.WriteString(line + "\n")
}
}