Skip to content

Instantly share code, notes, and snippets.

@caseylmanus
caseylmanus / main.go
Created May 20, 2025 14:29
rewrite grpc imports
package main
import (
"fmt"
"go/ast"
"go/parser"
"go/printer"
"go/token"
"go/types"
"os"
@skarllot
skarllot / Makefile.makefile
Created May 3, 2016 21:24
Makefile to merge coverage data from all subpackages (Golang)
.PHONY: test-cover-html
PACKAGES = $(shell find ./ -type d -not -path '*/\.*')
test-cover-html:
echo "mode: count" > coverage-all.out
$(foreach pkg,$(PACKAGES),\
go test -coverprofile=coverage.out -covermode=count $(pkg);\
tail -n +2 coverage.out >> coverage-all.out;)
go tool cover -html=coverage-all.out