Skip to content

Commit 8d8c4dc

Browse files
committed
fix typos in singleton's REDME
1 parent b0aa417 commit 8d8c4dc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

antipattern/singleton/README.md

+9-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
## Description
44

5-
The Singleton pattern aims to provide same instance of an objefct and guarantee that there are no duplicates. At the first call the instance is created. Following calls return first instance.
5+
The Singleton pattern aims to provide same instance of an object and guarantee
6+
that there are no duplicates. At the first call the instance is created.
7+
Following calls return first instance.
68

79
```go
810
firstInstance := GetInstance()
@@ -13,7 +15,7 @@ if firstInstance != secondInstance {
1315
}
1416
```
1517

16-
Any following calls, update first intance.
18+
Any following calls, update first instance.
1719

1820
```go
1921
thirdInstance := GetInstance()
@@ -24,4 +26,8 @@ if thirdInstance.NumberOfCalls() != 3 {
2426

2527
## Few words …
2628

27-
Is not good pattern if used to bring the state of the applicatoin and can cnange during its lifecycle. Making something global to avoid passing it around is a code smell. But use it to read configuration is good. Used to load a resource just first time is requested and to provide that resource everywere is a good way to use this pattern.
29+
Is not good pattern if used to bring the state of the application and can
30+
change during its life cycle. Making something global to avoid passing it
31+
around is a code smell. But use it to read configuration is good. Used to load
32+
a resource just first time is requested and to provide that resource every were
33+
is a good way to use this pattern.

0 commit comments

Comments
 (0)