Skip to content

Commit

Permalink
Fix docs style (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiendc authored Nov 18, 2024
1 parent 6a1b98d commit 4afcbca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ go get github.com/tiendc/go-apperrors

- Initializes `go-apperrors` at program startup

```
```go
import gae "github.com/tiendc/go-apperrors"

func main() {
Expand All @@ -41,7 +41,7 @@ func main() {

- Defines your errors

```
```go
// It is recommended to add a new directory for placing app errors.
// In this example, I use `apperrors/errors.go`.

Expand Down Expand Up @@ -72,7 +72,7 @@ var (

- Handles errors in your main processing code

```
```go
// There are some use cases as below.

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

- Handles validation errors

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

- Handles errors before returning them to client

```
```go
// In the base handler, implements function `RenderError()`
func RenderError(err error, requestWriter Writer) {
// Gets language from request, you can use util `gae.ParseAcceptLanguage()`
Expand Down

0 comments on commit 4afcbca

Please sign in to comment.