package realize import ( "gopkg.in/yaml.v2" "io/ioutil" "log" "os" "path/filepath" "time" ) // settings const const ( Permission = 0775 File = ".realize.yaml" FileOut = ".r.outputs.log" FileErr = ".r.errors.log" FileLog = ".r.logs.log" ) // random string preference const ( letterIdxBits = 6 // 6 bits to represent a letter index letterIdxMask = 1< 0 { log.Fatalln(Red.Regular(msg...), err.Error()) } else { log.Fatalln(err.Error()) } } } // Create a new file and return its pointer func (s Settings) Create(path string, name string) *os.File { file := filepath.Join(path, name) out, err := os.OpenFile(file, os.O_APPEND|os.O_WRONLY|os.O_CREATE|os.O_SYNC, Permission) s.Fatal(err) return out }