Skip to content

Commit 3fb5ca6

Browse files
authored
Fix typo (hoanhan101#32)
1 parent fd7a95d commit 3fb5ca6

File tree

10 files changed

+13
-13
lines changed

10 files changed

+13
-13
lines changed

go/design/error_3.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,5 @@ func Unmarshal(data []byte, v interface{}) error {
101101
// that's gonna create a cascading effect all the way through our code. We are no longer protected
102102
// by the decoupling of the error interface.
103103

104-
// This sometime has to happen. Can we do something differnt not to lose the decoupling. This is
104+
// This sometime has to happen. Can we do something different not to lose the decoupling. This is
105105
// where the idea of behavior as context comes in.

go/design/error_6.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (c *AppError) Error() string {
3737
func main() {
3838
// Make the function call and validate the error.
3939

40-
// firtCall calls secondCall calls thirdCall then results in AppError.
40+
// firstCall calls secondCall calls thirdCall then results in AppError.
4141
// Start down the call stack, in thirdCall, where the error occurs. The is the root of the
4242
// error. We return it up the call stack in our traditional error interface value.
4343
// Back to secondCall, we get the interface value and there is a concrete type stored inside

go/design/mocking_2.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
// publisher is an interface to allow this package to mock the pubsub package.
1616
// When we are writing our applications, declare our own interface that map out all the APIs call
1717
// we need for the APIs. The concrete types APIs in the previous files satisfy it out of the box.
18-
// We can write the entire application with mocking decoupling from conrete implementations.
18+
// We can write the entire application with mocking decoupling from concrete implementations.
1919
type publisher interface {
2020
Publish(key string, v interface{}) error
2121
Subscribe(key string) error

go/language/constant.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Constant are not variables.
2-
// Contants have a parallel type system all to themselves. The minimum precision for constant is
2+
// Constants have a parallel type system all to themselves. The minimum precision for constant is
33
// 256 bit. They are considered to be mathematically exact.
44
// Constants only exist at complied time.
55

@@ -14,7 +14,7 @@ func main() {
1414

1515
// Constant can be typed or untyped.
1616
// When it is untyped, we consider it as a kind.
17-
// They are implicitly converted by the complier.
17+
// They are implicitly converted by the compiler.
1818

1919
// Untyped Constants.
2020
const ui = 12345 // kind: integer

go/language/interface_1.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ type reader interface {
3737
// It is a concrete type because it has the method read below. It is identical to the method in
3838
// the reader interface. Because of this, we can say the concrete type file implements the reader
3939
// interface using a value receiver.
40-
// There is no fancy syntax. The complier can automatically recognize the implementation here.
40+
// There is no fancy syntax. The compiler can automatically recognize the implementation here.
4141

4242
// ------------
4343
// Relationship

go/language/map.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func main() {
7979
// This is a second way we can define users. We can use an existing type and use it as a base for
8080
// another type. These are two different types. There is no relationship here.
8181
// However, when we try use it as a key, like: u := make(map[users]int)
82-
// the complier says we cannot use that: "invalid map key type users"
82+
// the compiler says we cannot use that: "invalid map key type users"
8383
// The reason is: whatever we use for the key, the value must be comparable. We have to use it
8484
// in some sort of boolean expression in order for the map to create a hash value for it.
8585
}

go/language/method_1.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func (u user) notify() {
1818
}
1919

2020
// changeEmail implements a method with a pointer receiver: u of type pointer user
21-
// Using the pointer reciever, the method operates on shared access.
21+
// Using the pointer receiver, the method operates on shared access.
2222
func (u *user) changeEmail(email string) {
2323
u.email = email
2424
}

go/language/pointer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func increment2(inc *int) {
8686
}
8787

8888
// stayOnStack shows how the variable does not escape.
89-
// Since we know the size of the user value at compiled time, the complier will put this on a stack
89+
// Since we know the size of the user value at compiled time, the compiler will put this on a stack
9090
// frame.
9191
func stayOnStack() user {
9292
// In the stayOnStack stack frame, create a value and initialize it.
@@ -152,7 +152,7 @@ func escapeToHeap() *user {
152152
// cost.
153153

154154
// Because stack can grow, no Goroutine can have a pointer to some other Goroutine stack.
155-
// There would be too much overhead for complier to keep track of every pointer. The latency will
155+
// There would be too much overhead for compiler to keep track of every pointer. The latency will
156156
// be insane.
157157
// -> The stack for a Goroutine is only for that Goroutine only. It cannot be shared between
158158
// Goroutine.

go/language/slice.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func main() {
149149
// The length is slice3 is 2 and capacity is 6.
150150
// Parameters are [starting_index : (starting_index + length)]
151151
// By looking at the output, we can see that they are sharing the same backing array.
152-
// Thes slice headers get to stay on the stack when we use these value semantics. Only the
152+
// These slice headers get to stay on the stack when we use these value semantics. Only the
153153
// backing array that needed to be on the heap.
154154
slice3 := slice2[2:4]
155155

@@ -212,7 +212,7 @@ func main() {
212212

213213
// Append a new value to the slice. This line of code raises a red flag.
214214
// We have x is a slice with length 7, capacity 7. Since the length and capacity is the same,
215-
// append doubles its size then copy values over. x nows points to diffrent memeory block and
215+
// append doubles its size then copy values over. x nows points to different memory block and
216216
// has a length of 8, capacity of 14.
217217
x = append(x, 800)
218218

go/testing/web_server/handlers/handlers_example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// our API. More interestingly, Examples are not only for documentation but they can also be tests.
1212
// For them to be tests, we need to add a comment at the end of the functions: one is Output and
1313
// one is expected output. If we change the expected output to be something wrong then, the
14-
// complier will tell us when we run the test. Below is an example.
14+
// compiler will tell us when we run the test. Below is an example.
1515

1616
// Example tests are really powerful. They give users examples how to use the API and validate that
1717
// the APIs and examples are working.

0 commit comments

Comments
 (0)