diff options
| Commit | 3d3324e36311aadd02e25e8e11e5d98272c0aa0e (patch) | |
|---|---|---|
| Author | 2021-07-22 14:02:11 +0300 | |
| Committer | 2021-07-22 14:02:11 +0300 | |
| Files | 8e30ae5927148506d4644a8de1bbdc128fb53437 /go-src/utils | |
| ctfc-3d3324e36311aadd02e25e8e11e5d98272c0aa0e.tar ctfc-3d3324e36311aadd02e25e8e11e5d98272c0aa0e.tar.gz ctfc-3d3324e36311aadd02e25e8e11e5d98272c0aa0e.zip | ||
| Parent | ffc2c1273183b488de9cc4fc282379c2a042bd6d (diff) | |
Moved some stuff from windows.go to windowsHelpers.go, implemented some consistency and code organization improvements
1 files changed, 15 insertions, 0 deletions
| -rw-r--r-- | go-src/utils/utils.go | 15 |
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 +} |
