From 3d3324e36311aadd02e25e8e11e5d98272c0aa0e Mon Sep 17 00:00:00 2001 From: Syndamia Date: Thu, 22 Jul 2021 14:02:11 +0300 Subject: Moved some stuff from windows.go to windowsHelpers.go, implemented some consistency and code organization improvements --- go-src/utils/utils.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'go-src/utils') diff --git a/go-src/utils/utils.go b/go-src/utils/utils.go index 5676744..d241da6 100644 --- a/go-src/utils/utils.go +++ b/go-src/utils/utils.go @@ -33,3 +33,18 @@ func AppendToFile(path string, value string) { allChatsFile.WriteString(value) allChatsFile.Close() } + +func StrShortenRight(s *string, amount int) { + *s = (*s)[:len(*s)-amount] +} + +// Special thanks to icza, over on https://stackoverflow.com/a/59375088 for the If constuction + +type If bool + +func (c If) Int(a, b int) int { + if c { + return a + } + return b +} -- cgit v1.2.3