Use Sprintf style interpolation in client.
parent
052f7373fc
commit
c7f165a4e3
|
@ -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},
|
||||
|
|
Reference in New Issue