Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Troubeshooting #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
# ![RealWorld Example App](logo.png)


[![Build Status](https://travis-ci.org/wangzitian0/golang-gin-realworld-example-app.svg?branch=master)](https://travis-ci.org/wangzitian0/golang-gin-realworld-example-app)
[![codecov](https://codecov.io/gh/wangzitian0/golang-gin-realworld-example-app/branch/master/graph/badge.svg)](https://codecov.io/gh/wangzitian0/golang-gin-realworld-example-app)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/gothinkster/golang-gin-realworld-example-app/blob/master/LICENSE)
[![GoDoc](https://godoc.org/github.com/gothinkster/golang-gin-realworld-example-app?status.svg)](https://godoc.org/github.com/gothinkster/golang-gin-realworld-example-app)

> ### Golang/Gin codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the [RealWorld](https://github.com/gothinkster/realworld) spec and API.


This codebase was created to demonstrate a fully fledged fullstack application built with **Golang/Gin** including CRUD operations, authentication, routing, pagination, and more.


# Directory structure

```
.
├── gorm.db
Expand Down Expand Up @@ -42,31 +40,56 @@ https://golang.org/doc/install

Set-up the standard Go environment variables according to latest guidance (see https://golang.org/doc/install#install).


## Install Dependencies

From the project root, run:

```
go build ./...
go test ./...
go mod tidy
```

## Testing

From the project root, run:

```
go test ./...
```

or

```
go test ./... -cover
```

or

```
go test -v ./... -cover
```

depending on whether you want to see test coverage and how verbose the output you want.

## Troubleshooting

- Undefined validation function 'exists' on field 'Username'
If you get this error you should try downgrade to gin-gonic/[email protected] using:

```
go get github.com/gin-gonic/[email protected]
```

Then build and execute the project like:

```
go build
./golang-gin-realworld-example-app
```

## Todo

- More elegance config
- Test coverage (common & users 100%, article 0%)
- ProtoBuf support
Expand Down