Skip to content
This repository was archived by the owner on Jul 18, 2025. It is now read-only.

Commit 77bdd83

Browse files
Fix string(content) (which can be big) makes a copy of the content
Signed-off-by: Silvin Lubecki <[email protected]>
1 parent 7d0034a commit 77bdd83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packager/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717

1818
func prependToFile(filename, text string) {
1919
content, _ := ioutil.ReadFile(filename)
20-
content = []byte(text + string(content))
20+
content = append([]byte(text), content...)
2121
ioutil.WriteFile(filename, content, 0644)
2222
}
2323

0 commit comments

Comments
 (0)