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 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)
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user