I’m trying to run gofmt on all of the .go files in a directory, but not any 
subdirectories.  I have tried using “.” for the target.  It does get all of the 
.go in the current directory, but it also does all the .go files in 
subdirectories.  To be more specific: There is one particular subdirectory 
which I don’t want it to process: “_Save”.

 

The https://pkg.go.dev/cmd/go documentation says:

 

Directory and file names that begin with "." or "_" are ignored by the go tool, 
as are directories named "testdata".

 

I have used this in the past and it worked fine.  But it doesn’t seem to work 
now.

 

Besides “_Save”, I tried “.Save” and even “testdata”.  It processed all of 
them.  The command I am using is “gofmt -d .”.

 

The files in the “_Save” subdirectory are not part of my program’s build, some 
of them are .go files.  There are no references to them in my code, however.

 

Am I misunderstanding something?  Or not doing something correctly?

 

I’m doing this on Windows 10, by the way.

 

Thanks,

 

John

 

    John Souvestre    New Orleans LA, USA    504-454-0899

 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/00e601d9e5f5%2404b17ff0%240e147fd0%24%40Souvestre.com.

Reply via email to