loov / goda

Go Dependency Analysis toolkit
MIT License
1.37k stars 45 forks source link

expr: provide a way to select main packages #50

Closed rogpeppe closed 3 years ago

rogpeppe commented 3 years ago

Main packages are by definition roots, but we usually don't want to remove them; currently there's no way to make an expression that finds all sources that are not main packages.

How about a :main qualifier that selects only main packages. Then I can do (for example):

goda list ./...:source - ./...:main

to find all non-main source packages.

egonelbre commented 3 years ago

It's also possible to output that information in -f with {{ .Name }}, which would output "main" for a main package.