We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0a833b0 commit 20b70d0Copy full SHA for 20b70d0
1 file changed
core/format.go
@@ -25,7 +25,7 @@ func Format(opts Option) {
25
if err != nil {
26
return
27
}
28
- group := make(map[string][]*baseline.Baseline)
+ group := make(map[string]map[string]*baseline.Baseline)
29
for _, line := range bytes.Split(bytes.TrimSpace(content), []byte("\n")) {
30
var result baseline.Baseline
31
err := json.Unmarshal(line, &result)
@@ -37,7 +37,10 @@ func Format(opts Option) {
37
38
continue
39
40
- group[result.Url.Host] = append(group[result.Url.Host], &result)
+ if _, exists := group[result.Url.Host]; !exists {
41
+ group[result.Url.Host] = make(map[string]*baseline.Baseline)
42
+ }
43
+ group[result.Url.Host][result.Path] = &result
44
45
46
for _, results := range group {
0 commit comments