gothinkster / golang-gin-realworld-example-app

Exemplary real world application built with Golang + Gin
https://realworld.io
MIT License
2.5k stars 495 forks source link

More instructions #4

Closed silkcom closed 6 years ago

silkcom commented 6 years ago

Right now trying to follow the readme throws several errors. Including golang.org's x crypto is not found (easy ish fix), going to / returns a 404 which might be expected? and running the tests has several failures.

It'd be very awesome to have a where to go from here section in your readme and more complete instructions on how to get the backend to startup successfully.

silkcom commented 6 years ago

i read the tests wrong, there are several red warnings that tables don't exist from gorm. The tests do pass

wangzitian commented 6 years ago

Thanks for your advices, I will fix errors when I have time. Could you please explain more about where to go from here section in your readme and more complete instructions? R u means more introduction about 3rd tools or packages?

dparizek commented 6 years ago

What is easy-ish fix for golang.org's x crypto is not found ? @silkcom I am total newbie... how do I fix that?

wangzitian0 commented 6 years ago

Could you plz patse your error info or log?

dparizek commented 6 years ago

21:0:08 main | Build Failed: users/models.go:8:2: cannot find package "golang.org/x/crypto/bcrypt" in any of: /Users/dave/go/src/gozoca/vendor/golang.org/x/crypto/bcrypt (vendor tree) /usr/local/go/src/golang.org/x/crypto/bcrypt (from $GOROOT) /Users/dave/go/src/golang.org/x/crypto/bcrypt (from $GOPATH)

dparizek commented 6 years ago

hmm... seems right place... https://godoc.org/golang.org/x/crypto/bcrypt

wangzitian0 commented 6 years ago

https://stackoverflow.com/questions/31334197/failed-to-install-golang-org-x-crypto-bcrypt?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa

Could this solve your problem?

dparizek commented 6 years ago

Yes! solved problem. THANK YOU!!

wangzitian0 commented 6 years ago

Was it related to codes? If so, you could give a pr to fixed it. Thanks

dparizek commented 6 years ago

I think is an issue with golang... your link gives temp solution of install from github instead... so probably does not warrant a PR / fix - should be fixed at golang.org I think.. not sure

I will investigate further and then do PR. Also want to do something to deal with CORS issues.

wangzitian commented 6 years ago

Never mind, it's a weird issue. You can use this CORS middleware: https://github.com/gin-contrib/cors.

wangzitian commented 6 years ago

@dparizek The depended package was managed by govendor which could be checked in vendor/vendor.json. The reason was that I didn't included the package /x/crypto/bcrypt, I might install it before this project. BTW, do you meet the issue silkcom meet throws several errors?