markbates / pkger

Embed static files in Go binaries (replacement for gobuffalo/packr)
MIT License
1.19k stars 60 forks source link

Add exclude flag to list and pack commands #112

Open jankaszel opened 4 years ago

jankaszel commented 4 years ago

Continuing work from https://github.com/markbates/pkger/pull/108 on adding an -exclude flag for ignoring particular directories to both the list and pack commands. Includes tests and documentation.

Tests fail at the moment. This is due to bugs within the testing framework as I've laid out in https://github.com/markbates/pkger/pull/108#issuecomment-656200823:

Tests fail though, as they do on the main branch atm. @markbates to me it occurs that there is a bug in pkging/pkgtest that will somehow keep references to the first directory created by pkgtest.NewRef() for subsequent tests. As the first directory will be deleted after the first test passed, subsequent tests will fail due to the missing directory. Didn't find a solution for that bug, but if you comment out line 26 in the above parser_test.go, tests for the excludes argument will pass.

jankaszel commented 4 years ago

@markbates cheers, any plans to get this merged?

aeneasr commented 4 years ago

Would be great if this could be merged!

cornelk commented 4 years ago

@markbates any chance to get this merged?

jankaszel commented 3 years ago

FYI the embed library introduced in Go 1.16 could offer a viable alternative for folks running into issues with pkger related to large directories that should be ignored: https://golang.org/doc/go1.16#library-embed