merge singleton pattern

This commit is contained in:
Edward 2020-05-27 21:53:18 +08:00
parent 88466123ca
commit 8ef40f53f2
4 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@
A curated collection of idiomatic design & application patterns for Go language. 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 ## Merged Repos
@ -123,4 +123,4 @@ A curated collection of idiomatic design & application patterns for Go language.
## A pattern implementation ## 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)

View File

@ -18,8 +18,8 @@ func BigIntFactorial(x big.Int) *big.Int {
defer Duration(time.Now(), "IntFactorial") defer Duration(time.Now(), "IntFactorial")
y := big.NewInt(1) y := big.NewInt(1)
for one := big.NewInt(1); x.Sign() > 0; x.Sub(x, one) { for one := big.NewInt(1); x.Sign() > 0; x.Sub(&x, one) {
y.Mul(y, x) y.Mul(y, &x)
} }
return x.Set(y) return x.Set(y)