gtr: rename Package.AddProperty to Package.SetProperty

Properties are stored in a map, so SetProperty better reflects its
behaviour.
This commit is contained in:
Joël Stemmer 2022-03-14 22:59:44 +00:00
parent 24c2ee41ce
commit 5e492f8212
2 changed files with 2 additions and 2 deletions

View File

@ -89,7 +89,7 @@ func main() {
report := gtr.FromEvents(events, *packageName) report := gtr.FromEvents(events, *packageName)
for i := range report.Packages { for i := range report.Packages {
for k, v := range properties { for k, v := range properties {
report.Packages[i].AddProperty(k, v) report.Packages[i].SetProperty(k, v)
} }
} }

View File

@ -40,7 +40,7 @@ type Package struct {
RunError Error RunError Error
} }
func (p *Package) AddProperty(key, value string) { func (p *Package) SetProperty(key, value string) {
if p.Properties == nil { if p.Properties == nil {
p.Properties = make(map[string]string) p.Properties = make(map[string]string)
} }