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 test route handler is correct #2

Open
josh-gree opened this issue Apr 19, 2019 · 0 comments
Open

Go test route handler is correct #2

josh-gree opened this issue Apr 19, 2019 · 0 comments

Comments

@josh-gree
Copy link
Owner

Not sure how to do this. Can get a list of routes each of which is a struct;

type RouteInfo struct {
	Method  string
	Path    string
	Handler string
}

So if the handler func is main.Handler then the actual string in the struct is dependent on the location the file is at test time so could be;

github.com/joshgree/showcase_project/endpoint.Handler for instance.

However this is liable to change when testing locally and testing during build. Would like something along the lines of __file__ in python!?

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

No branches or pull requests

1 participant