#handling go:embed directives

1 messages · Page 1 of 1 (latest)

west heart
#

I was wondering if there is a nice way to handle go:embed directives, without manually adding them to ignore exclusions?

eg

func (* Module) Build(
  // +defaultPath="."
  // +ignore=["*", "!go.mod", "!go.sum", "!**/*.go", "!pkg/with/embeded/templates/*"]
)

right now my best idea is to write a dagger function that searches the entire repo for go:embed directives and patches its own source code with an updated +ignore directive

golden sentinel
#

I'm thinking that maybe having a pre-processing feature where Dagger calls some of your code before actually sending the context could be useful? cc @devout meadow @night ravine @west kelp

west heart