Golang REST API With Mux

In this video we will look at building a simple REST API using the Go programming language along with the Mux router. I will also explain some of the fundamentals of the language for beginners.


CODE: Github Repo

BECOME A PATRON: Show support & get perks!


VISIT MY WEBISTE: Check Out My Udemy Courses



Fransisco Wijaya says:


Trouty McSquire says:

This was excellent Brad. The syntax for Goland is very appealing and I look forward to more tutorials.

Truth Detective says:

I know this question is off the topic, but I really wanna know if I should learn jQuery anymore. If it’s about DOM, I have no problem with vanilla javascript and animations can be easily done with CSS animations. Is there anything else that I need jQuery for? I’d love to hear the answer, specifically from Brad.

Shahid says:

Have u tried cmder its really cool command line tool for windows

Emmanuel Mutale says:

I have been waiting for this, Thanks traversy. Can’t wait for the course.Go is my favorite language,just started learning it

Benbird Z says:

Finally! Thanks so much for doing this, pls do a course on this!

Roushan jha says:

please upload new tutorials for golang

nsl3109 says:

Hey Brad, great job on all of these tutorials!
[preface: I am pretty new to web dev]
Quick question on something not related to this video – I’ve built a web app (Materialize framework) structured like the one in your NodeJS + MongoDB Article Database series from a while back and I was wondering – what would be the best way to convert it to mobile? (I just want to be able to use it on my phone, doesn’t have to be big on app store, etc)
There are a few options that I’ve thought of/just read about:
1) Getting a domain for the web app and just manually search it up in browser on phone
2) Using Apache Cordova to convert web to mobile app (I don’t know how legit this would be)
3) Redesigning the whole app using Ionic and Angular in one of your previous tutorials
4) Redesigning the whole app using React Native instead (I don’t know how difficult or practical this would be)
5) Redesigning whole app using Meteorjs (is this even legit?)
Again, I haven’t explored these options in depth yet and I don’t know the frameworks very well but I would appreciate any suggestions that you have.

james bake says:

Are the parenthesis supposed to be purple? Mine aren’t and it’s the only I can’t think of a good reason why mine isn’t working

Jason Bishop says:

Create course!…..Thank you. Awesome!

August Nejudne says:

Hi Brad! I’ve already bought a few of your courses on Udemy and I learned a ton from them. But I’m wondering if you could make a course making a social media app, like a facebook clone, using angular and firestore.

Daniel Sokil says:

I was shocked to see this video. THANKS! You are awesome. So is golang

Alvaro Chévez says:

Excellent video Brad! Thank you very much!

saeful rahman says:

hello, why my go run run very slow on my windows pc, yours is much faster to compile, i’m using i7 pc

mirekum says:

Great tutorial, we’re waiting for the second part

Medoune Kane says:

Thanks again Brad!!! God Bless you!!!

Muhammad Arifin says:

this is the best go tutorial for bignner ever I seen….

Андрей Артеха says:

I think a lot of us would by a course about go from you. Hit the like if you’re would too.

Leandrit Ferizi says:

When will the course come up? Golang lacks courses in Youtube, Udemy and so on. It will be big I am sure.

freddiλN says:

Why did you decide to capitalize the structs in this project? I mean they worked just fine for me in lowercase and (afaik) having them start with an uppercase letter would only export them (which wouldn’t be needed in this small project).

LocKerz Edward says:

The ugliest language ever.
But your channel is great!

Jon Brookes says:

Thanks again Brad. Another really good tutorial. Go is by far my favourite language just now and for the purpose of serving json apis in this manner is highly performant. You’ve shown how to get this done efficiently and explain how to get there in a very clear and easy to understand way.

Eduardo mendoza says:

Nice course mate, you should create a Ruby on Rails course on Udemy, will buy for sure!!

Tharindu Lakshitha says:

Loved it! And waiting for the 2nd part with database <3

Abdallah AlSahhar says:

what golang framework you suggest to learn, like what is the most popular ?

Paul Bird says:

For the update function didn’t need to do anything with the ID as the book object included the right ID .

func updateBook(w http.ResponseWriter, r *http.Request) {
w.Header().Set(“Content-Type”, “application/json”)
params := mux.Vars(r)
var book Book
_ = json.NewDecoder(r.Body).Decode(&book)
for index, item := range books {
if item.ID == params[“id”] {
books = append(books[:index], books[index+1:]…)
books = append(books, book)

张洪铭 says:

Great! Love your style~

toan le says:

Hello Traversy, do you have a golang + vuejs/reactjs course on udemy ?

 Write a comment


Do you like our videos?
Do you want to see more like that?

Please click below to support us on Facebook!