Skip to content
This repository was archived by the owner on Sep 4, 2025. It is now read-only.

Commit bf4e01d

Browse files
nstratosaren55555
authored andcommitted
Use go build instead of go run for example app (#127)
Using go run $GOPATH/src/github.com/google/jsonapi/examples/app.go as shown in the Readme, leads to errors (#126) since go run requires all the .go files of a program. This commit changes the Readme to show how to run the example app using go build to avoid this issue.
1 parent e0fc4ee commit bf4e01d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ all of your data easily.
7676

7777
[examples/app.go](https://github.com/google/jsonapi/blob/master/examples/app.go)
7878

79-
This runnable file demonstrates the implementation of a create, a show,
79+
This program demonstrates the implementation of a create, a show,
8080
and a list [http.Handler](http://golang.org/pkg/net/http#Handler). It
8181
outputs some example requests and responses as well as serialized
8282
examples of the source/target structs to json. That is to say, I show
@@ -85,13 +85,13 @@ turned it into your struct types.
8585

8686
To run,
8787

88-
* Make sure you have go installed
88+
* Make sure you have [Go installed](https://golang.org/doc/install)
8989
* Create the following directories or similar: `~/go`
9090
* Set `GOPATH` to `PWD` in your shell session, `export GOPATH=$PWD`
9191
* `go get github.com/google/jsonapi`. (Append `-u` after `get` if you
9292
are updating.)
93-
* `go run $GOPATH/src/github.com/google/jsonapi/examples/app.go` or `cd
94-
$GOPATH/src/github.com/google/jsonapi/examples && go run app.go`
93+
* `cd $GOPATH/src/github.com/google/jsonapi/examples`
94+
* `go build && ./examples`
9595

9696
## `jsonapi` Tag Reference
9797

0 commit comments

Comments
 (0)