diff --git a/.gitignore b/.gitignore index 8c0ef176682fc346f7a5f987e40c6f3422e4d78d..6517223e15d4d3953260ae070504d165726e671c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ *.obj *.lzh .*.swp +dupl.html diff --git a/Makefile b/Makefile index 57f50a0c598a35d28a4acaa6fc4cf6b3f761cd15..614e5346c176dcc895bcc69e73bb0323e940985a 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,12 @@ all: go generate ./... go install ./... +dupl: + find . -name '*.go' \ + | grep -Fv .sql.go \ + | go tool github.com/mibk/dupl -html -t 50 -files \ + > dupl.html + xdg-open dupl.html # vim:ft=make # diff --git a/go.mod b/go.mod index 9c7734ce979e5bd7f3b0d4a204096b6d2b961d6f..733481691d13c37758cb7a9f43d2861ba3a26505 100644 --- a/go.mod +++ b/go.mod @@ -61,6 +61,7 @@ require ( github.com/lucasb-eyer/go-colorful v1.2.0 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect + github.com/mibk/dupl v1.0.0 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/ncruces/go-strftime v0.1.9 // indirect @@ -113,4 +114,7 @@ require ( mvdan.cc/gofumpt v0.7.0 // indirect ) -tool github.com/sqlc-dev/sqlc/cmd/sqlc +tool ( + github.com/mibk/dupl + github.com/sqlc-dev/sqlc/cmd/sqlc +) diff --git a/go.sum b/go.sum index af023d1b9c6830623e473d4f394f5da83b7259db..89449aacd34112dd3092ae76bf5481a948bcf187 100644 --- a/go.sum +++ b/go.sum @@ -122,6 +122,8 @@ github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6T github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= +github.com/mibk/dupl v1.0.0 h1:aZc3jqrF9n0tUHwHt/+jsRxA8cRgA0Gdl56M7W7PoqE= +github.com/mibk/dupl v1.0.0/go.mod h1:pCr4pNxxIbFGvtyCOi0c7LVjmV6duhKWV+ex5vh38ME= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ=