From d990a0559effaa84b9e0ea85f9e42675c237b6c8 Mon Sep 17 00:00:00 2001 From: ston1th Date: Thu, 3 Jun 2021 20:39:00 +0200 Subject: [PATCH] use array --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index e807145..af4ffd4 100644 --- a/main.go +++ b/main.go @@ -175,7 +175,7 @@ func main() { gc := make(chan *Grid, 10) if text { go func() { - buf := make([]byte, (size*size)+size*6) + var buf [size * (size + 6)]byte for { buf[0] = '+' c := 1 @@ -212,7 +212,7 @@ func main() { buf[c] = '+' c++ buf[c] = '\n' - fmt.Printf("\r%s", string(buf)) + fmt.Printf("\r%s", string(buf[:])) } }() } else {