type should not define nested (#212)

* nest type should not supported

* nest type should not supported

* nest type should not supported

* nest type should not supported

* new test

* new test
This commit is contained in:
kingxt
2020-11-17 18:08:55 +08:00
committed by GitHub
parent 9592639cb4
commit d6d8fc21d8
5 changed files with 88 additions and 29 deletions

View File

@@ -26,19 +26,6 @@ func MaybeCreateFile(dir, subdir, file string) (fp *os.File, created bool, err e
return
}
func ClearAndOpenFile(fpath string) (*os.File, error) {
f, err := os.OpenFile(fpath, os.O_WRONLY|os.O_TRUNC, 0600)
if err != nil {
return nil, err
}
_, err = f.WriteString("")
if err != nil {
return nil, err
}
return f, nil
}
func WrapErr(err error, message string) error {
return errors.New(message + ", " + err.Error())
}