<p>I'm making a simple webserver that will use Google's oauth2 endpoint to protect some resources but I don't understand how to use x/oauth2.
Thanks</p>
<hr/>**评论:**<br/><br/>cube2222: <pre><p>Here you are:
<a href="https://jacobmartins.com/2016/02/29/getting-started-with-oauth2-in-go/" rel="nofollow">https://jacobmartins.com/2016/02/29/getting-started-with-oauth2-in-go/</a></p></pre>ROFLLOLSTER: <pre><p>Thank you so much</p></pre>cube2222: <pre><p>You're welcome!</p></pre>doki_pen: <pre><p>This is good for getting a general understanding of how oauth works: <a href="http://oauthbible.com/" rel="nofollow">http://oauthbible.com/</a></p></pre>tuxlinuxien: <pre><p>I have just wrote this one using github.com/gin-gonic/gin but you can easily modify it to use net/http.</p>
<p><a href="https://gist.github.com/tuxlinuxien/29aa0ddaaa33c506c6220266bbb632a1" rel="nofollow">https://gist.github.com/tuxlinuxien/29aa0ddaaa33c506c6220266bbb632a1</a></p></pre>
![](https://static.golangjob.cn/static/img/banner.png)