Skip to content

Instantly share code, notes, and snippets.

@dlisboa
Last active August 21, 2024 21:13
Show Gist options
  • Select an option

  • Save dlisboa/aae2a50532e2d566dff1b1d2dd30691c to your computer and use it in GitHub Desktop.

Select an option

Save dlisboa/aae2a50532e2d566dff1b1d2dd30691c to your computer and use it in GitHub Desktop.
Using a tools.go mod for dev dependencies
module diogo.li/camelot/tools
go 1.22.5
require (
github.com/cespare/reflex v0.3.1
github.com/golangci/golangci-lint v1.60.2
)
// -- DO NOT COPY --
// all the indirect dependencies of the packages above
default:
just --list
export GOBIN := `echo $PWD/bin`
@devsetup:
echo "installing dev dependencies at $GOBIN ..."
go install -C ./tools github.com/golangci/golangci-lint/cmd/golangci-lint
go install -C ./tools github.com/cespare/reflex
# ou assim:
# setup all dev stuff
@devsetup2 $GOBIN=`echo $PWD/bin`:
cat ./tools/tools.go | grep _ | awk -F'"' '{print $2}' | xargs go install -C ./tools
# ou dá para listar assim:
# go list -C tools -e -f '{{join .Imports "\n"}}'
package tools
import (
_ "github.com/cespare/reflex"
_ "github.com/golangci/golangci-lint/cmd/golangci-lint"
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment