markbates / refresh

MIT License
191 stars 30 forks source link

Example of programmatic usage #37

Closed talentlessguy closed 5 years ago

talentlessguy commented 5 years ago

I would like to use this module in go-web-app but I don't know how to use this module in go code. @markbates, could you please give a small example? Also would be nice to put it in README :cat:

markbates commented 5 years ago

https://github.com/gobuffalo/buffalo/blob/master/buffalo/cmd/dev.go

PRs, especially for docs, are always welcome!

talentlessguy commented 5 years ago

https://github.com/gobuffalo/buffalo/blob/master/buffalo/cmd/dev.go

PRs, especially for docs, are always welcome!

The example you sent me uses a modification of the package cos this one only has .Version property (I didn't look at the code). Could you give a more clear example please?

image

markbates commented 5 years ago

That is the best example. If you read the entire thing you will see that there are more than one package imported. The GoDoc for these packages is very helpful to read as it might answer your questions.

talentlessguy commented 5 years ago

That is the best example. If you read the entire thing you will see that there are more than one package imported. The GoDoc for these packages is very helpful to read as it might answer your questions.

Sorry for my stupidity but I can't find any comments and examples in GoDoc. What does NewWithContext do in your code and what ctx should be? I'm a lil confused :(

image