# How to create a REST API in Golang with serverless

**URL:** <https://discourse.sst.dev/t/how-to-create-a-rest-api-in-golang-with-serverless/2367>\
**Category:** General\
**Created:** [April 4, 2021, 8:29pm UTC](https://discourse.sst.dev/t/how-to-create-a-rest-api-in-golang-with-serverless/2367 "2021-04-04T20:29:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [April 4, 2021, 8:29pm UTC](https://discourse.sst.dev/t/how-to-create-a-rest-api-in-golang-with-serverless/2367/1 "2021-04-04T20:29:49Z")

</div>

Link to chapter — [https://serverless-stack.com/examples/how-to-create-a-rest-api-in-golang-with-serverless.html](https://serverless-stack.com/examples/how-to-create-a-rest-api-in-golang-with-serverless.html)

---

<div class="post-metadata">

**Author:** ![Loschcode](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/loschcode/32/1474_2.png) [@Loschcode](https://discourse.sst.dev/u/Loschcode)\
**Post date:** [August 13, 2023, 3:25pm UTC](https://discourse.sst.dev/t/how-to-create-a-rest-api-in-golang-with-serverless/2367/2 "2023-08-13T15:25:12Z")

</div>

I just created an account to give a big warning on the fact your example of REST API in Golang is flat-out wrong on multiple levels and will absolutely not work at any point. Like declaring multiple times the same package name? The fact it systematically crashes on the build/call of the HTTP server? The fact the given sourcecode isn’t even iso with your tutorial examples?

Like, is the guy who wrote that even a Golang developer? Did he try what he wrote? Or was it generated by ChatGPT or something?

---

<div class="post-metadata">

**Author:** ![jayair](https://yyz2.discourse-cdn.com/flex032/user_avatar/discourse.sst.dev/jayair/32/9_2.png) [@jayair](https://discourse.sst.dev/u/jayair)\
**Post date:** [August 17, 2023, 10:52pm UTC](https://discourse.sst.dev/t/how-to-create-a-rest-api-in-golang-with-serverless/2367/3 "2023-08-17T22:52:51Z")

</div>

I think it might’ve gotten edited along the way. Would appreciate a PR for this!
