github.com/sercand/please@v13.4.0+incompatible/src/query/filter.go (about) 1 package query 2 3 import ( 4 "fmt" 5 6 "github.com/thought-machine/please/src/core" 7 ) 8 9 // Filter takes the list of BuildLabels and checks which ones match the label selectors passed in. 10 func Filter(state *core.BuildState, labels core.BuildLabels) { 11 12 // Eventually this could be more clever... 13 matcher := state.ShouldInclude 14 15 for _, label := range labels { 16 if matcher(state.Graph.TargetOrDie(label)) { 17 fmt.Println(label) 18 } 19 } 20 }