summaryrefslogtreecommitdiff
path: root/template.go
diff options
context:
space:
mode:
authorRené 'Necoro' Neumann <necoro@necoro.eu>2022-01-23 23:52:53 +0100
committerRené 'Necoro' Neumann <necoro@necoro.eu>2022-01-23 23:52:53 +0100
commitcc27626d016f8e13cfc86291ae9ddfc1a6e9d09a (patch)
tree044777f6359dcfc01d82a52521ae34b866651f97 /template.go
parent27791043e7e07ba33ffde6d180fcad9bfa992921 (diff)
downloadengarde-importer-cc27626d016f8e13cfc86291ae9ddfc1a6e9d09a.tar.gz
engarde-importer-cc27626d016f8e13cfc86291ae9ddfc1a6e9d09a.tar.bz2
engarde-importer-cc27626d016f8e13cfc86291ae9ddfc1a6e9d09a.zip
Factor out `encodedWriter`
Diffstat (limited to '')
-rw-r--r--template.go6
1 files changed, 1 insertions, 5 deletions
diff --git a/template.go b/template.go
index 67cd565..ce1127a 100644
--- a/template.go
+++ b/template.go
@@ -7,8 +7,6 @@ import (
"io/fs"
"os"
"path"
-
- "golang.org/x/text/encoding/charmap"
)
const verbatimPath = "templates/verbatim"
@@ -33,9 +31,7 @@ func writeVerbatimFile(outputDir string, entry fs.DirEntry) error {
}
defer output.Close()
- encodedOutput := charmap.ISO8859_1.NewEncoder().Writer(output)
-
- if _, err = io.Copy(encodedOutput, input); err != nil {
+ if _, err = io.Copy(encodedWriter(output), input); err != nil {
return fmt.Errorf("writing to '%s': %w", outName, err)
}