summaryrefslogtreecommitdiff
path: root/wget.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2019-06-06 21:27:31 -0700
committerJeff Carr <[email protected]>2019-06-06 21:27:31 -0700
commit8db41cc911abf01ea566831adeb20275c8068cb2 (patch)
tree5bd7ac247acf9315a4679c3f1e957cbe94fa91e1 /wget.go
parenta12da586e9eb271ea31365257399fda8437dd3ea (diff)
always append \n when writing a file
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'wget.go')
-rw-r--r--wget.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/wget.go b/wget.go
index 68ad12d..c0f66cc 100644
--- a/wget.go
+++ b/wget.go
@@ -58,7 +58,15 @@ func WgetToFile(filepath string, url string) error {
return err
}
+// write out a file. Always be nice and end with '\n'
+// if you are here and want to complain about ending in '\n'
+// then you probably aren't going to like lots of things in this
+// package. I will quote the evilwm man page:
+//
+// BUGS: The author's idea of friendly may differ to that of many other people.
+//
func Write(filepath string, data string) bool {
+ data = Chomp(data) + "\n"
// Create the file
out, err := os.Create(filepath)
if err != nil {