diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-07-09 17:04:28 +0300 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-07-09 17:04:49 +0300 |
| commit | 7457f7af8effa21ecf328058475e944e46075670 (patch) | |
| tree | 0f82e043d693871e72b8c02e5a73b72b8d16177c /go-src/utils | |
| parent | 1490ddda1d20ef23a4e5ec908405869073abbf8d (diff) | |
| download | ctfc-7457f7af8effa21ecf328058475e944e46075670.tar ctfc-7457f7af8effa21ecf328058475e944e46075670.tar.gz ctfc-7457f7af8effa21ecf328058475e944e46075670.zip | |
Implemented sending chat messages and implemented chat UI
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() +} |
