Code Monkey home page Code Monkey logo

Comments (3)

onattech avatar onattech commented on June 13, 2024 1

Thank you for your reply. It turns out I am familiar with the first option. Gqlgen for graphql uses it. I'll probably go with the second option since there is a Makefile to install other dependencies.

from gotestsum.

dnephin avatar dnephin commented on June 13, 2024

Interesting question!

One option is something like this: https://play-with-go.dev/tools-as-dependencies_go119_en/. You can include it as an import in a project, but I guess that requires that someone run using go run gotest.tools/gotestsum, instead of simply gotestsum.

If you use a Makefile or some other tool for project tasks, you could include go install gotest.tools/gotestsum@latest to get it installed.

A third option, which is pretty unconventional, is something like #151, where you run go run ./test instead of go test, and that runs the tests with gotestsum.

from gotestsum.

dnephin avatar dnephin commented on June 13, 2024

I learned about another option which should work like "auto install". You can run go tools like this without then being in the go.mod file:

go run gotest.tools/gotestsum@latest [gotestsum flags]

If the module already exists in $GOPATH/pkg/mod/... it will run it. It the source isn't available locally it will download the source, compile, and run.

gotestsum has very few dependencies, so it doesn't take long to download and compile on the fly like this.

from gotestsum.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.