mirror of
https://github.com/crazybber/awesome-patterns.git
synced 2024-11-24 05:26:02 +03:00
merge singleton pattern
This commit is contained in:
parent
88466123ca
commit
8ef40f53f2
@ -11,7 +11,7 @@
|
||||
|
||||
A curated collection of idiomatic design & application patterns for Go language.
|
||||
|
||||
#### a fork of [tmrts/go-patterns](https://github.com/tmrts/go-patterns) but merged in with other awesome forks. can go with [patterns-in-examples](https://github.com/crazybber/go-fucking-patterns)
|
||||
#### a fork of [tmrts/go-patterns](https://github.com/tmrts/go-patterns) but merged in with other awesome forks. can go with [patterns-in-examples](https://github.com/crazybber/go-pattern-examples)
|
||||
|
||||
|
||||
## Merged Repos
|
||||
@ -123,4 +123,4 @@ A curated collection of idiomatic design & application patterns for Go language.
|
||||
|
||||
## A pattern implementation
|
||||
|
||||
[go-patterns-in-examples](https://github.com/crazybber/go-fucking-patterns)
|
||||
[go-patterns-in-examples](https://github.com/crazybber/go-pattern-examples)
|
||||
|
@ -18,8 +18,8 @@ func BigIntFactorial(x big.Int) *big.Int {
|
||||
defer Duration(time.Now(), "IntFactorial")
|
||||
|
||||
y := big.NewInt(1)
|
||||
for one := big.NewInt(1); x.Sign() > 0; x.Sub(x, one) {
|
||||
y.Mul(y, x)
|
||||
for one := big.NewInt(1); x.Sign() > 0; x.Sub(&x, one) {
|
||||
y.Mul(y, &x)
|
||||
}
|
||||
|
||||
return x.Set(y)
|
||||
|
Loading…
Reference in New Issue
Block a user