Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit removes the anonymous import of the `github.com/coreos/pkg/capnslog` package, which breaks / changes logging in subtle ways. Importing that package has a side-effect due to the `capnslog`'s `init` function, which sets a global logger. By blank-importing it, we "fixed" the order of package-loading so that this does not cause any issues. However, for other services depending on policy-engine (like issue-policies) this side-effect still exists and has to be handled in [weird ways](https://github.com/snyk/issue-policies/blob/fdab20f0b2984340fd78638cd2b1482097c73e61/internal/core/log/log.go#L12). It looks like we've upgraded and changed our code enough to get rid of that import though since this was added - compiling policy-engine and checking the imported modules shows no sign of the `github.com/coreos/pkg` module anymore: ``` $ # before this change: $ go version -m ./policy-engine | rg 'coreos' dep github.com/coreos/go-systemd v0.0.0-20191104093116-d3cd4ed1dbcf h1:iW4rZ826su+pqaw19uhpSCzhj44qo35pNgKFGqzDKkU= dep github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f h1:lBNOc5arjvs8E5mO2tbpBpLoyyu8B6e44T7hJy6potg= $ # with this change: $ go version -m ./policy-engine | rg 'coreos' $ ``` This means that upstream users can also get rid of code handling this annoying side effect. [NARW-2842]
- Loading branch information