From ec7514e592e37cabcbc006ea53aeb5f0dabef09a Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 3 Aug 2018 09:51:54 -0700 Subject: [PATCH] Replace Fprintf calls with SetText calls --- Makefile | 4 ++++ clocks/display.go | 2 +- gerrit/display.go | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bde2f7a7..dfa59a84 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,10 @@ install: go install -ldflags="-s -w -X main.version=$(shell git describe --always --abbrev=6) -X main.date=$(shell date +%FT%T%z)" which wtf +lint: + structcheck ./... + varcheck ./... + run: build bin/wtf diff --git a/clocks/display.go b/clocks/display.go index d59e243a..44fedbbf 100644 --- a/clocks/display.go +++ b/clocks/display.go @@ -8,7 +8,7 @@ import ( func (widget *Widget) display(clocks []Clock) { if len(clocks) == 0 { - fmt.Fprintf(widget.View, "\n%s", " no timezone data available") + widget.View.SetText(fmt.Sprintf("\n%s", " no timezone data available")) return } diff --git a/gerrit/display.go b/gerrit/display.go index 6a9cd499..24645197 100644 --- a/gerrit/display.go +++ b/gerrit/display.go @@ -10,7 +10,7 @@ func (widget *Widget) display() { project := widget.currentGerritProject() if project == nil { - fmt.Fprintf(widget.View, "%s", " Gerrit project data is unavailable (1)") + widget.View.SetText(fmt.Sprintf("%s", " Gerrit project data is unavailable (1)")) return }