package internal import "fmt" type PlaceholderStyle int const ( QuestionMark PlaceholderStyle = iota DollarNumber ColonNumber ) type Placeholder struct { style PlaceholderStyle count int } func NewPlaceholder(style PlaceholderStyle) *Placeholder { return &Placeholder{style: style} } func (p *Placeholder) Next() string { p.count++ switch p.style { case DollarNumber: return fmt.Sprintf("$%d", p.count) case ColonNumber: return fmt.Sprintf(":%d", p.count) default: return "?" } } func (p *Placeholder) Reset() { p.count = 0 } func (p *Placeholder) Count() int { return p.count }