Use Sprintf style interpolation in client.

master
J. David Lee 2019-06-11 11:55:52 +02:00
parent 052f7373fc
commit c7f165a4e3
1 changed files with 4 additions and 2 deletions

View File

@ -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},