From 7457f7af8effa21ecf328058475e944e46075670 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 9 Jul 2021 17:04:28 +0300 Subject: Implemented sending chat messages and implemented chat UI --- go-src/utils/utils.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'go-src/utils') 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() +} -- cgit v1.2.3