From fed24bffa85d6d8eb350ae9d0b9b75441fd4ea90 Mon Sep 17 00:00:00 2001 From: Jack Bizzell Date: Fri, 29 Apr 2022 12:46:28 +0100 Subject: [PATCH] remove unnecessary calls to fmt.[x]f --- main.go | 2 +- statements.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index cde814b..311c14f 100644 --- a/main.go +++ b/main.go @@ -82,7 +82,7 @@ func init() { h += " curl -s http://jsonplaceholder.typicode.com/users/1 | gron\n" h += " gron http://jsonplaceholder.typicode.com/users/1 | grep company | gron --ungron\n" - fmt.Fprintf(os.Stderr, h) + fmt.Fprint(os.Stderr, h) } } diff --git a/statements.go b/statements.go index ed1b469..b3794bc 100644 --- a/statements.go +++ b/statements.go @@ -213,7 +213,7 @@ func statementFromJSONSpec(str string) (statement, error) { if err != nil { return nil, errors.Wrap(err, "JSON internal error") } - nstr = fmt.Sprintf("%s", nbuf) + nstr = string(nbuf) s = append(s, token{nstr, typNumericKey}) default: ok = false @@ -259,7 +259,7 @@ func statementFromJSONSpec(str string) (statement, error) { if err != nil { return nil, errors.Wrap(err, "JSON internal error") } - nstr = fmt.Sprintf("%s", nbuf) + nstr = string(nbuf) s = append(s, token{nstr, t}) s = append(s, token{";", typSemi})