File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import (
18
18
"log"
19
19
"os"
20
20
"sort"
21
+ "strings"
21
22
22
23
"golang.org/x/tools/cover"
23
24
)
@@ -109,7 +110,26 @@ func main() {
109
110
for _ , file := range flag .Args () {
110
111
profiles , err := cover .ParseProfiles (file )
111
112
if err != nil {
112
- log .Fatalf ("failed to parse profiles: %v" , err )
113
+
114
+ // for testing only
115
+ f , _ := os .Open (file )
116
+ defer f .Close ()
117
+ scanner := bufio .NewScanner (f )
118
+ i := 0
119
+ lines := []string {}
120
+ for scanner .Scan () {
121
+ if i > 10 {
122
+ break
123
+ }
124
+ i ++
125
+ lines = append (lines , scanner .Text ())
126
+ }
127
+ fmt .Println ("=== " + file + " ==============================" )
128
+ fmt .Printf ("%s\n " , strings .Join (lines , "\n " ))
129
+ fmt .Println ("===============================================" )
130
+ // end
131
+
132
+ log .Fatalf ("failed to parse profile '%s': %v" , file , err )
113
133
}
114
134
for _ , p := range profiles {
115
135
merged = addProfile (merged , p )
You can’t perform that action at this time.
0 commit comments