diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2022-01-23 23:52:53 +0100 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2022-01-23 23:52:53 +0100 |
commit | cc27626d016f8e13cfc86291ae9ddfc1a6e9d09a (patch) | |
tree | 044777f6359dcfc01d82a52521ae34b866651f97 /template.go | |
parent | 27791043e7e07ba33ffde6d180fcad9bfa992921 (diff) | |
download | engarde-importer-cc27626d016f8e13cfc86291ae9ddfc1a6e9d09a.tar.gz engarde-importer-cc27626d016f8e13cfc86291ae9ddfc1a6e9d09a.tar.bz2 engarde-importer-cc27626d016f8e13cfc86291ae9ddfc1a6e9d09a.zip |
Factor out `encodedWriter`
Diffstat (limited to '')
-rw-r--r-- | template.go | 6 |
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) } |