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

"Go Compilation Error" following "Quick Start" guide #8

Open
hubyhuby opened this issue Feb 3, 2018 · 4 comments
Open

"Go Compilation Error" following "Quick Start" guide #8

hubyhuby opened this issue Feb 3, 2018 · 4 comments

Comments

@hubyhuby
Copy link

hubyhuby commented Feb 3, 2018

Thanks for this project, its exactely what I am lloking to quick start my project.

I have been following the "Quick Start" procedure from the github.
Installed revel OK
Installed "go get github.com/richtr/baseapp/..." , I have a first error here :
go get github.com/richtr/baseapp/... package github.com/richtr/baseapp/app/controllers imports github.com/richtr/baseapp/app/routes: cannot find package "github.com/richtr/baseapp/app/routes" in any of: /usr/lib/go-1.7/src/github.com/richtr/baseapp/app/routes (from $GOROOT) /home/yann/Documents/projects/src/github.com/richtr/baseapp/app/routes (from $GOPATH)

EDIT: Looking there I don t see /routes :
https://github.com/richtr/baseapp/tree/master/app


GIVES with revel run github.com/richtr/baseapp test
`ERROR 11:54:14 revel build.go:146: # github.com/richtr/baseapp/vendor/github.com/revel/modules/jobs/app/controllers
Documents/projects/src/github.com/richtr/baseapp/vendor/github.com/revel/modules/jobs/app/controllers/status.go:18: invalid operation: c.Controller.Request.Header["X-Forwarded-For"] (type *revel.RevelHeader does not support indexing)

github.com/richtr/baseapp/vendor/github.com/lib/pq

Documents/projects/src/github.com/richtr/baseapp/vendor/github.com/lib/pq/conn_go18.go:14: undefined: driver.NamedValue
Documents/projects/src/github.com/richtr/baseapp/vendor/github.com/lib/pq/conn_go18.go:29: undefined: driver.NamedValue
Documents/projects/src/github.com/richtr/baseapp/vendor/github.com/lib/pq/conn_go18.go:43: undefined: driver.TxOptions

github.com/richtr/baseapp/vendor/github.com/mattn/go-sqlite3

Documents/projects/src/github.com/richtr/baseapp/vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go:26: undefined: driver.NamedValue
Documents/projects/src/github.com/richtr/baseapp/vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go:35: undefined: driver.NamedValue
Documents/projects/src/github.com/richtr/baseapp/vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go:49: undefined: driver.TxOptions
Documents/projects/src/github.com/richtr/baseapp/vendor/github.com/mattn/go-sqlite3/sqlite3_go18.go:54: undefined: driver.NamedValue
Documents/projects/src/github.com/richt`

I installed manually "routes" like this and the ERROR 11:54:14 revel build.go:146 disapeared:
go get github.com/richtr/baseapp/app/routes


Now when I run "revel run github.com/richtr/baseapp test" I get only warnings:

WARN 12:13:30 revel reflect.go:725: Type found in package: controllers, but did not embed from: revel.Controller name=TestSuiteDesc path=github.com/revel/modules/testrunner/app/controllers
WARN 12:13:30 revel reflect.go:725: Type found in package: controllers, but did not embed from: revel.Controller name=TestDesc path=github.com/revel/modules/testrunner/app/controllers
WARN 12:13:30 revel reflect.go:725: Type found in package: controllers, but did not embed from: revel.Controller name=TestSuiteResult path=github.com/revel/modules/testrunner/app/controllers
WARN 12:13:30 revel reflect.go:725: Type found in package: controllers, but did not embed from: revel.Controller name=TestResult path=github.com/revel/modules/testrunner/app/controllers
INFO 12:13:30 revel build.go:235: Cleaning dir tmp
INFO 12:13:30 revel build.go:235: Cleaning dir routes
INFO 12:13:30 revel build.go:87: Vendor folder detected, scanning for deps in path
WARN 12:13:30 revel build.go:93: Build: dep executable not found in PATH, but vendor folder detected.Packages can only be added automatically to the vendor folder using the dep tool. You can install the dep tool by doing a go get -u github.com/golang/dep/cmd/dep

I get on Localhost 9000 :
image

@xiongchao123
Copy link

I got this problem too

@jakpren
Copy link

jakpren commented May 15, 2018

Are any buddies fixed this issue?
Just commented these lines in status.go and I proceeded,

screen shot 2018-05-15 at 5 17 00 pm

@martyj
Copy link

martyj commented May 17, 2018

The code is checking to see if our HTTP request is being proxied by a loadbalancer, which is why it is looking at the "X-Forwarded-For" for the IP. If our requests are being proxied, all the request IPs will show up as the loadbalancer.

Here is my fix:
(Untested under loadbalancing)

-               if proxiedAddress, isProxied := c.Request.Header["X-Forwarded-For"]; isProxied {
-                       remoteAddress = proxiedAddress[0]
+               if proxiedAddress := c.Request.Header.Get("X-Forwarded-For"); len(proxiedAddress) > 0 {
+                       remoteAddress = proxiedAddress

Basically, we pull the header and compare its length.

@hubyhuby
Copy link
Author

Hi there,
I am not following anymore on this issue, I have moved on using go buffalo framework.
Please feel free to close when you think it is time too ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants