goda icon indicating copy to clipboard operation
goda copied to clipboard

Listing the source files, in a module, associated with a GOOS or a GOOS/GOARCH pair

Open nim-nim opened this issue 6 years ago • 4 comments

With the advent of Go modules one can no longer ignore the side-effects of including files targeting a GOOS or a GOOS/GOARCH pair one does not need: their deps will end up in go module deps, and go will pull all the other modules those deps require, recursively.

So when you integrate software for Linux, for example, you now have to deal with a lot of windows or freebsd or whatever- support modules you have no actual need of, just because they are declared in module deps.

Therefore, we'd like to trim Go modules to only the GOOS (or alternatively GOOS+GOARCHES couples) we integrate for, to avoid this problem. Unfortunately go list and friends are especially useless, because they only know to list

  • "all source files" or
  • "all source files for this GOOS and Go build tags" + "other source files"

Which is not the correct splitting point for us. Go build tags can include other things that Go arches, and what we really need is "all source files for this GOOS, including all arches and all build tags" or "all source files for this GOOS and GOARCH, including all the combinations of build tags which are not GOARCH bits"

So if goda could provide this kind of listing, that would be useful to us.

nim-nim avatar Mar 29 '19 09:03 nim-nim

Thanks for the issues they help to make the tool better. So, keep em coming :).

egonelbre avatar Mar 29 '19 10:03 egonelbre

Thanks for caring!

Go is currently living its own mid-life crisis: it has made easy to write a lot of code, so now there is this huge pile of code to manage and maintain. It's an opportunity for tools like goda, you chose the right time to release it.

nim-nim avatar Mar 29 '19 11:03 nim-nim

Did you ever find a way to do this?

paralin avatar Jul 02 '22 02:07 paralin

@paralin unfortunately no, but I also haven't put any significant time into thinking about this problem.

egonelbre avatar Jul 02 '22 07:07 egonelbre