HandleFuncs can now be Type Methods as well.#2
HandleFuncs can now be Type Methods as well.#2ivaningrooves wants to merge 2 commits intos-mang:masterfrom
Conversation
`http.HandleFunc` documentation was not discovered because only
first class functions were traversed when building apib documentation.
Now both first class functions and type methods are traversed.
For example:
type WidgetController struct {}
// GetTypeWidget retrieves a single Widget
func (* WidgetController) GetWidget(w, r) { }
|
Hi! Thanks so much for the PR, I'm sorry I haven't had a chance to review your code yet, things have been busy with work and Women Who Go. I will try to review your code this weekend. Sarah |
|
Hi Sarah, funny when you said Women Who Go at first, I thought you meant the go board Cheers, Ivan Ivan On Wed, Jun 22, 2016 at 5:55 PM, Sarah Adams notifications@github.com
|
|
Yea, the tests were already broken. You can run the example pkg tests and check the output manually. You've rewritten all the imports to |
|
Yes, how would you do this if you were me? The PR contains 2 commits; the Ivan On Mon, Jul 18, 2016 at 9:57 AM, Sarah Adams notifications@github.com
|
|
Ah, so pull requests are based off branches. So you need to get rid of the second commit in this branch. What I would do is: $ cd $GOPATH/github.com/ivaningrooves/test2doc
$ git checkout master # you're probably already on the master branch
$ git checkout -b tmp # save the current state of your master branch on a new branch, `tmp`
$ git checkout master # checkout master branch again
$ git reset --hard HEAD^ # reset backwards 1 commit from HEAD
$ git push -f origin master # force-push the new state of your master branchNow if you ever want to look at the second commit again, it will be on the Hope that helps! |
|
Thank you! You should be able to build & run the PR now. Ivan On Mon, Jul 18, 2016 at 10:48 AM, Sarah Adams notifications@github.com
|
|
Hm, it looks like the imports are still pointing at your code and not mine. Did you follow the steps I outlined above? Or did you do something else |
| ./scripts/combine.sh | ||
| ``` | ||
|
|
||
| final apib doc file is generated at `example/apidoc.apib` No newline at end of file |
|
It looks like you deleted my example pkg too :( |
|
Hi Sarah, I did remove the changes from the PR but I had to add them back to my fork Ivan On Mon, Jul 18, 2016 at 4:28 PM, Sarah Adams notifications@github.com
|
|
I created a new PR #3 |
|
See #3 |
http.HandleFuncdocumentation was not discovered because onlyfirst class functions were traversed when building apib documentation.
Now both first class functions and type methods are traversed.
For example: