github.com/shravanasati/hydra@v1.0.1-0.20240122045627-1082d2ed50d2/src/utils.go (about)

     1  package main
     2  
     3  import (
     4  	"fmt"
     5  	"os"
     6  )
     7  
     8  // makeFile creates a file with the provided content.
     9  func makeFile(filename, content string) {
    10  	f, e := os.Create(filename)
    11  	handleException(e)
    12  	_, er := f.WriteString(content)
    13  	handleException(er)
    14  	defer f.Close()
    15  	cwd, _ := os.Getwd()
    16  	fmt.Printf("\n - Created file '%v' at %v.", filename, cwd)
    17  }