Hi,

FWIW I believe printing every build constraint for every file skipped is
far too verbose, even for -n or -v mode.
It is not uncommon to use build constraints and when you do, you often do
it for many or even all files in a package. I don't even think it would be
helpful, because it would be very hard to glean the relevant information
from it.

That's notably very different from a distinct flag or command, which
doesn't spam in the common case and can filter the information down to a
more useful subset.

Why build a regexp later for something build tool knows in situ?
>

You don't need a regexp. You just need to grep for `// +build`. In the
future (after go 1.18), you can grep for `//go:build` and get a per-file
DNF form of all build constraints in a package.

Again, just to be on record: I'm not denying the usefulness of tooling
being able to give you more insight into if and why files are excluded from
the build.

(https://play.golang.org/p/BeYjYFgLTuU)
>
> export GOOS=linux
> cd buildconstr
>
> CURRENT:
>
> go build -n -tags bsddebug
> package fairbe.org/ohir/buildconstr: build constraints exclude all Go
> files in /path.../buildconstr
>
>
> DESIRED:
>
> go build -n -tags bsddebug
>    (command config lines elided)
> ./a.go excluded at line 4: // +build darwin freebsd netbsd openbsd
> ./b.go excluded at line 3: // +build lindebug,linux
> ./c.go excluded at line 3: // +build !lindebug,!bsddebug
> ./d.go excluded at line 3: // +build windows
> ./e_windows.go excluded by name constraint (GOOS != windows)
> package github.com/ohir/buildconstr: build constraints exclude all Go
> files in /path.../buildconstr
>
>
> TC,
>
> --
> Wojciech S. Czarnecki
>  << ^oo^ >> OHIR-RIPE
>
> --
> 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/20210330140808.20c13b4d%40xmint
> .
>

-- 
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/CAEkBMfFMnMys4A1wOkW266DKCf5v6Tq%3DqAsxPoEee%2BFUVnhbWg%40mail.gmail.com.

Reply via email to