diff options
| Commit | 7457f7af8effa21ecf328058475e944e46075670 (patch) | |
|---|---|---|
| Author | 2021-07-09 17:04:28 +0300 | |
| Committer | 2021-07-09 17:04:49 +0300 | |
| Files | 0f82e043d693871e72b8c02e5a73b72b8d16177c /go-src/utils | |
| ctfc-7457f7af8effa21ecf328058475e944e46075670.tar ctfc-7457f7af8effa21ecf328058475e944e46075670.tar.gz ctfc-7457f7af8effa21ecf328058475e944e46075670.zip | ||
| Parent | 1490ddda1d20ef23a4e5ec908405869073abbf8d (diff) | |
Implemented sending chat messages and implemented chat UI
1 files changed, 8 insertions, 0 deletions
| -rw-r--r-- | go-src/utils/utils.go | 8 |
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() +} |
