forked from redis/go-redis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request redis#1495 from go-redis/fix/dependency-chain
Reduce dependency chain
- Loading branch information
Showing
10 changed files
with
59 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
module github.com/go-redis/redis/v8 | ||
|
||
go 1.11 | ||
|
||
require ( | ||
github.com/cespare/xxhash/v2 v2.1.1 | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f | ||
github.com/kr/pretty v0.1.0 // indirect | ||
github.com/onsi/ginkgo v1.14.1 | ||
github.com/onsi/gomega v1.10.2 | ||
go.opentelemetry.io/otel v0.11.0 | ||
golang.org/x/exp v0.0.0-20200908183739-ae8ad444f925 | ||
golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1 // indirect | ||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect | ||
) | ||
|
||
go 1.11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package rand | ||
|
||
import ( | ||
"math/rand" | ||
"sync" | ||
) | ||
|
||
// Int returns a non-negative pseudo-random int. | ||
func Int() int { return pseudo.Int() } | ||
|
||
// Intn returns, as an int, a non-negative pseudo-random number in [0,n). | ||
// It panics if n <= 0. | ||
func Intn(n int) int { return pseudo.Intn(n) } | ||
|
||
// Int63n returns, as an int64, a non-negative pseudo-random number in [0,n). | ||
// It panics if n <= 0. | ||
func Int63n(n int64) int64 { return pseudo.Int63n(n) } | ||
|
||
// Perm returns, as a slice of n ints, a pseudo-random permutation of the integers [0,n). | ||
func Perm(n int) []int { return pseudo.Perm(n) } | ||
|
||
// Seed uses the provided seed value to initialize the default Source to a | ||
// deterministic state. If Seed is not called, the generator behaves as if | ||
// seeded by Seed(1). | ||
func Seed(n int64) { pseudo.Seed(n) } | ||
|
||
var pseudo = rand.New(&source{src: rand.NewSource(1)}) | ||
|
||
type source struct { | ||
src rand.Source | ||
mu sync.Mutex | ||
} | ||
|
||
func (s *source) Int63() int64 { | ||
s.mu.Lock() | ||
n := s.src.Int63() | ||
s.mu.Unlock() | ||
return n | ||
} | ||
|
||
func (s *source) Seed(seed int64) { | ||
s.mu.Lock() | ||
s.src.Seed(seed) | ||
s.mu.Unlock() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters