I have a routine that I want to test, that I have to pass a flag into this test. This is on Win10 using Go 1.20.4
This is the func signature:
func detoxFilenameNewWay(fName string) (string, bool) {
I want to pass a flag I call dots into the test code for this function. I tried from within the correct directory
go test --args -dots
# or
go test . --args -dots
Or from the top of my source tree where the go.mod file is :
go test .\detox --args -dots
I get an error message saying:
flag provided but not defined: -dots.
But that flag does show up when I run the program using the -h
flag.
What am I missing?
Thx
The code I want to test is here: https://go.dev/play/p/p-YeGDk1KaM
BTW, the previous question's solution that's similar to mine, from 2014, does not work for me.