Fix linting issues

This commit is contained in:
WestleyR
2021-09-06 12:03:04 -07:00
parent 31e9929984
commit 4edc16953e
71 changed files with 470 additions and 363 deletions

View File

@@ -4,14 +4,21 @@ import (
"io/ioutil"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/pkg/errors"
)
func WriteData(source string, dest string) error {
bytes, err := getResource(source)
if err != nil {
return errors.Wrap(err, "failed to get resource")
}
err = ioutil.WriteFile(dest, bytes, 0644)
if err != nil {
// TODO: remove log message if appropriate
wwlog.Printf(wwlog.ERROR, "Failed writing %s to: %s\n", dest, err)
return err
return errors.Wrap(err, "failed to write to file")
}
return nil
}