diff options
Diffstat (limited to 'go-src/utils')
| -rw-r--r-- | go-src/utils/utils.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/go-src/utils/utils.go b/go-src/utils/utils.go index f50ab50..754c7ed 100644 --- a/go-src/utils/utils.go +++ b/go-src/utils/utils.go @@ -1,5 +1,7 @@ package utils +import "os" + // Repeats a rune given amount of times and returns the result as a string func RepeatRune(r rune, times int) (result string) { for i := 0; i < times; i++ { @@ -23,3 +25,9 @@ func TwoDByteArrayToStringArray(in [][]byte) (result []string) { } return } + +func AppendToFile(path string, value string) { + allChatsFile, _ := os.OpenFile(path, os.O_APPEND|os.O_WRONLY, 0644) + allChatsFile.WriteString(value) + allChatsFile.Close() +} |
