Skip to content

Commit 4afcbca

Browse files
authored
Fix docs style (#12)
1 parent 6a1b98d commit 4afcbca

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ go get github.com/tiendc/go-apperrors
2323

2424
- Initializes `go-apperrors` at program startup
2525

26-
```
26+
```go
2727
import gae "github.com/tiendc/go-apperrors"
2828

2929
func main() {
@@ -41,7 +41,7 @@ func main() {
4141

4242
- Defines your errors
4343

44-
```
44+
```go
4545
// It is recommended to add a new directory for placing app errors.
4646
// In this example, I use `apperrors/errors.go`.
4747

@@ -72,7 +72,7 @@ var (
7272

7373
- Handles errors in your main processing code
7474

75-
```
75+
```go
7676
// There are some use cases as below.
7777

7878
// 1. You get an unexpected error
@@ -101,7 +101,7 @@ if `user.ID` is not in `project.userIDs` {
101101

102102
- Handles validation errors
103103

104-
```
104+
```go
105105
// Validation is normally performed when you parse requests from client.
106106
// You may use an external lib for the validation. That's why you need to make
107107
// `adapter` code to transform the validation errors to `AppError`s.
@@ -134,7 +134,7 @@ func (req UpdateProjectReq) Validate() gae.ValidationError {
134134

135135
- Handles errors before returning them to client
136136

137-
```
137+
```go
138138
// In the base handler, implements function `RenderError()`
139139
func RenderError(err error, requestWriter Writer) {
140140
// Gets language from request, you can use util `gae.ParseAcceptLanguage()`

0 commit comments

Comments
 (0)