pkger/apply.go

21 lines
389 B
Go
Raw Permalink Normal View History

2019-09-22 23:47:40 +03:00
// +build !debug
2019-09-21 19:51:29 +03:00
package pkger
import (
"github.com/markbates/pkger/pkging"
)
2019-10-16 18:07:57 +03:00
// Apply will wrap the current implementation
// of pkger.Pkger with the new pkg. This allows
// for layering of pkging.Pkger implementations.
2019-09-21 19:51:29 +03:00
func Apply(pkg pkging.Pkger, err error) error {
2019-10-16 18:07:57 +03:00
if err != nil {
return err
}
2019-09-22 23:47:40 +03:00
gil.Lock()
defer gil.Unlock()
2019-09-21 19:51:29 +03:00
current = pkging.Wrap(current, pkg)
return nil
}