rwxrob-dot/scripts/goc

7 lines
313 B
Plaintext
Raw Normal View History

2022-02-09 07:29:05 +00:00
#!/usr/bin/env bash
go test -coverprofile=/tmp/cover
go tool cover -html=/tmp/cover -o /tmp/cover.html
perl -e 'local $/; open $fh,"<", $ARGV[0]; $buf=<$fh>; $buf=~s,<span\s+class="cov0"[^>]+>([^<]+)</span>,<b>\1</b>,gms; print $buf' /tmp/cover.html >/tmp/cover-lynx.html
lynx /tmp/cover-lynx.html
rm /tmp/cover*