Skip to content

Instantly share code, notes, and snippets.

View Terminator637's full-sized avatar
🎯
Focusing

Denis Terminator637

🎯
Focusing
  • Space307
  • St. Petersburg
  • 09:34 (UTC +03:00)
View GitHub Profile
@Terminator637
Terminator637 / golang_coverage.sh
Created February 10, 2019 15:57
Script that prints the test coverage of the entire package and generates the coverage in HTML
#!/bin/sh
touch ./coverage.tmp &&
echo 'mode: atomic' > coverage.out &&
go list ./... | grep -v /mocks | grep -v /pb | xargs -n1 -I{} sh -c 'go test -v -race -covermode=atomic -coverprofile=coverage.tmp -coverpkg $(go list ./... | grep -v /mocks | grep -v /pb | tr "\n" ",") {} && tail -n +2 coverage.tmp >> coverage.out || exit 255' && rm coverage.tmp &&
go tool cover -func=coverage.out &&
go tool cover -html=coverage.out -o coverage.html &&
rm coverage.out
@Terminator637
Terminator637 / Goland_FileWatcher_golangci-lint.xml
Last active February 10, 2019 15:20
Jetbrains Goland FileWatcher golangci-lint
<TaskOptions>
<TaskOptions>
<option name="arguments" value="run --print-issued-lines=false $FileDir$ --fast" />
<option name="checkSyntaxErrors" value="false" />
<option name="description" />
<option name="exitCodeBehavior" value="NEVER" />
<option name="fileExtension" value="go" />
<option name="immediateSync" value="true" />
<option name="name" value="golangci-lint" />
<option name="output" value="" />