This commit is contained in:
fatedier
2018-07-12 00:31:21 +08:00
parent 0d02f291e3
commit d74b45be5d
9 changed files with 123 additions and 9 deletions

View File

@@ -1,9 +1,13 @@
package util
package config
import (
"io/ioutil"
"os"
"path/filepath"
)
func GenerateConfigFile(path string, content string) error {
return ioutil.WriteFile(path, []byte(content), 0666)
func GenerateConfigFile(path string, content string) (realPath string, err error) {
realPath = filepath.Join(os.TempDir(), path)
err = ioutil.WriteFile(realPath, []byte(content), 0666)
return realPath, err
}