Export/Results as CSV#519
Conversation
Signed-off-by: Sacha Telgenhof <me@sachatelgenhof.com>
Signed-off-by: Sacha Telgenhof <me@sachatelgenhof.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #519 +/- ##
==========================================
- Coverage 87.28% 85.75% -1.53%
==========================================
Files 33 34 +1
Lines 928 983 +55
==========================================
+ Hits 810 843 +33
- Misses 94 116 +22
Partials 24 24 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| buf.WriteString(`"Page URL","Link URL",Status` + "\n") | ||
|
|
||
| for _, link := range r.Links { | ||
| buf.WriteString(`"` + strings.ReplaceAll(r.URL, `"`, `""`) + `","` + |
There was a problem hiding this comment.
Can we use the encoding/csv package?
There was a problem hiding this comment.
I wanted to be accurate and ensure that string fields are always quoted, since URL's technically can have comma's (as per RFC 3986). For example in the query string. My first attempt was actually using the encode/csv package, however read somewhere that it doesn't quote by default or otherwise quote every field, so opted for this approach.
However, after some more reading, I think my understanding may have been wrong and can actually use the encoding/csv instead. I'll do some refactoring 😄
Adds a new format to export the results to CSV.
Close #126.