pkger/apply.go

21 lines
289 B
Go
Raw Normal View History

2019-09-21 19:51:29 +03:00
package pkger
import (
"sync"
"github.com/markbates/pkger/pkging"
)
var current pkging.Pkger
var gil = &sync.RWMutex{}
func Apply(pkg pkging.Pkger, err error) error {
if err != nil {
return err
}
gil.Lock()
defer gil.Unlock()
current = pkging.Wrap(current, pkg)
return nil
}