cleanup: move init funcs to the top of the source
We make sure they're not hiding at the bottom or in the middle which makes debugging an utter nightmare! Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
This commit is contained in:
parent
d9abc517e8
commit
d8ff41a344
14 changed files with 203 additions and 201 deletions
|
@ -20,14 +20,20 @@ import (
|
|||
"github.com/opencontainers/go-digest"
|
||||
)
|
||||
|
||||
var sbsMu sync.Mutex
|
||||
var randSource rand.Rand
|
||||
var (
|
||||
sbsMu sync.Mutex
|
||||
randSource rand.Rand
|
||||
)
|
||||
|
||||
type statsBlobStore struct {
|
||||
stats map[string]int
|
||||
blobs distribution.BlobStore
|
||||
}
|
||||
|
||||
func init() {
|
||||
randSource = *rand.New(rand.NewSource(42))
|
||||
}
|
||||
|
||||
func (sbs statsBlobStore) Put(ctx context.Context, mediaType string, p []byte) (distribution.Descriptor, error) {
|
||||
sbsMu.Lock()
|
||||
sbs.stats["put"]++
|
||||
|
@ -195,10 +201,6 @@ func makeBlob(size int) []byte {
|
|||
return blob
|
||||
}
|
||||
|
||||
func init() {
|
||||
randSource = *rand.New(rand.NewSource(42))
|
||||
}
|
||||
|
||||
func populate(t *testing.T, te *testEnv, blobCount, size, numUnique int) {
|
||||
var inRemote []distribution.Descriptor
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue