Plugin - Accept format strings+data for AddLine
Most calls were being made from fmt.Sprintf() anyway, so it was clear this required formatted input.
This commit is contained in:
parent
a856b449a8
commit
31850c9901
1 changed files with 3 additions and 3 deletions
|
@ -58,17 +58,17 @@ func (p *Plugin) SetState(status Status, message string) {
|
|||
}
|
||||
|
||||
// AddLine adds the specified string to the extra output text buffer.
|
||||
func (p *Plugin) AddLine(line string) {
|
||||
func (p *Plugin) AddLine(format string, data ...interface{}) {
|
||||
if p.extraText == nil {
|
||||
p.extraText = list.New()
|
||||
}
|
||||
p.extraText.PushBack(line)
|
||||
p.extraText.PushBack(fmt.Sprintf(format, data...))
|
||||
}
|
||||
|
||||
// AddLines add the specified `lines` to the output text.
|
||||
func (p *Plugin) AddLines(lines []string) {
|
||||
for _, line := range lines {
|
||||
p.AddLine(line)
|
||||
p.AddLine("%s", line)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue