Giter Site home page Giter Site logo

`go test -v` stops working about flag HOT 4 CLOSED

namsral avatar namsral commented on June 12, 2024
`go test -v` stops working

from flag.

Comments (4)

wyc avatar wyc commented on June 12, 2024

Okay, as a hack to make it work, I added this to my global vars:

var chatty = flag.Bool("test.v", false, "verbose: print additional output")

Taken from here: https://golang.org/src/testing/testing.go#L232

Now using only your package, this particular flag seems to work. Of course this isn't ideal as the others are still broken, but I guess I'll keep adding them to my project as needed until we get a fix here. E.g., go test -trace my.trace isn't working.

from flag.

wyc avatar wyc commented on June 12, 2024

I see this issue describing the same thing: #9

Here are steps to reproduce:

  1. Download this gist into its own directory: https://gist.github.com/wyc/b6d7dae829e613e5260e4310061161de
  2. Run go test -v

The result should be something like this:

$ go test -v
flag provided but not defined: -test.v
Usage of /tmp/go-build338776245/_/tmp/repro/_test/repro.test:
exit status 2
FAIL    _/tmp/repro 0.001s

from flag.

namsral avatar namsral commented on June 12, 2024

Thanks for taking the time to describe the problem and write a test.

Please test d922432 in the testflag branch for a fix.

from flag.

wyc avatar wyc commented on June 12, 2024

Hey, thanks for the swift response on this! I really appreciate it. Your solution works perfectly for me.

Added a test here in case you wanted one:
#11

Consider it solved!

from flag.

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.