From eb5b35e205eaf294fed5491152b7bb87d6f44168 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann Date: Thu, 25 Nov 2021 22:45:14 +0100 Subject: [PATCH] waveshare213v2: Avoid using strconv.Itoa fmt.Sprintf() can format numbers directly using the "%d" format specifier. Signed-off-by: Michael Hanselmann --- waveshare2in13v2/waveshare213v2.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/waveshare2in13v2/waveshare213v2.go b/waveshare2in13v2/waveshare213v2.go index 597fdc0..63f117d 100644 --- a/waveshare2in13v2/waveshare213v2.go +++ b/waveshare2in13v2/waveshare213v2.go @@ -9,7 +9,6 @@ import ( "image" "image/color" "image/draw" - "strconv" "time" "periph.io/x/conn/v3" @@ -402,7 +401,7 @@ func (d *Dev) Halt() error { // String returns a string containing configuration information. func (d *Dev) String() string { - return fmt.Sprintf("epd.Dev{%s, %s, Height: %s, Width: %s}", d.c, d.dc, strconv.Itoa(d.opts.Height), strconv.Itoa(d.opts.Width)) + return fmt.Sprintf("epd.Dev{%s, %s, Height: %d, Width: %d}", d.c, d.dc, d.opts.Height, d.opts.Width) } func (d *Dev) sendData(c []byte) error { @@ -451,7 +450,6 @@ func (d *Dev) reset() error { time.Sleep(200 * time.Millisecond) return eh.err - } func (d *Dev) waitUntilIdle() {