diff options
Diffstat (limited to 'internal/storage/files/writer.go')
-rw-r--r-- | internal/storage/files/writer.go | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/internal/storage/files/writer.go b/internal/storage/files/writer.go index 6f10fe7..9831435 100644 --- a/internal/storage/files/writer.go +++ b/internal/storage/files/writer.go @@ -6,7 +6,6 @@ import ( "io" "io/fs" "os" - "path" "path/filepath" "go.alanpearce.eu/x/log" @@ -75,7 +74,7 @@ func (f *Files) Open(filename string) (io.ReadCloser, error) { } func (f *Files) OutputToFile(output io.Reader, filename string) error { - fn := path.Join(f.outputDirectory, filename) + fn := filepath.Join(f.outputDirectory, filename) if err := f.mkdirp(filepath.Dir(filename)); err != nil { return err } @@ -94,7 +93,7 @@ func (f *Files) OutputToFile(output io.Reader, filename string) error { } func (f *Files) RenderToFile(component templ.Component, filename string) error { - fn := path.Join(f.outputDirectory, filename) + fn := filepath.Join(f.outputDirectory, filename) if err := f.mkdirp(filepath.Dir(filename)); err != nil { return err } @@ -113,7 +112,7 @@ func (f *Files) RenderToFile(component templ.Component, filename string) error { } func (f *Files) WriterToFile(writer io.WriterTo, filename string) error { - fn := path.Join(f.outputDirectory, filename) + fn := filepath.Join(f.outputDirectory, filename) if err := f.mkdirp(filepath.Dir(filename)); err != nil { return err } @@ -206,7 +205,7 @@ func (f *Files) openFileAndVariants(filename string) (io.WriteCloser, error) { func (f *Files) mkdirp(dir string) error { f.log.Debug("creating directory", "dir", dir) - err := os.MkdirAll(path.Join(f.outputDirectory, dir), 0755) + err := os.MkdirAll(filepath.Join(f.outputDirectory, dir), 0755) return errors.WithMessage(err, "could not create directory") } |