From c7f165a4e36961bb7142c999b751acc4183ccd0b Mon Sep 17 00:00:00 2001 From: "J. David Lee" Date: Tue, 11 Jun 2019 11:55:52 +0200 Subject: [PATCH] Use Sprintf style interpolation in client. --- amclient/client.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/amclient/client.go b/amclient/client.go index 769bed5..169850f 100644 --- a/amclient/client.go +++ b/amclient/client.go @@ -41,14 +41,16 @@ func (cl Client) Ping() error { }) } -func (cl Client) Log(text string) error { +func (cl Client) Log(text string, args ...interface{}) error { + text = fmt.Sprintf(text, args...) return cl.post(url.Values{ "action": []string{"log"}, "text": []string{text}, }) } -func (cl Client) Alert(text string) error { +func (cl Client) Alert(text string, args ...interface{}) error { + text = fmt.Sprintf(text, args...) return cl.post(url.Values{ "action": []string{"alert"}, "text": []string{text},