Golang REST API With Mux

preview_player
Показать описание
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.

SPONSOR: GDP HOST - WANT CHEAP WEB HOSTING?

CODE: Github Repo

BECOME A PATRON: Show support & get perks!

ONE TIME DONATIONS:

VISIT MY WEBISTE: Check Out My Udemy Courses

FOLLOW TRAVERSY MEDIA:
Рекомендации по теме
Комментарии
Автор

Brad! You are genius! Looking forward to your Golang course. You definitely have a gift to share your knowledge.

forzaforza
Автор

I'd 100% buy an intermediate/advanced Golang course from you.

Pikoro
Автор

"I'm actually thinking of doing a course on it."
YES!!!!

samdavepollard
Автор

37:20 I got an explanation from chatgpt which absolutely cool.

books = append(books[:index],
books[index+1:]...)
This line removes the matched item from the books slice. It does this by "slicing" around the current index:

books[:index] is the part of the slice up to (but not including) the element at index.
books[index+1:] is the part of the slice after index.
append(books[:index], books[index+1:]...) combines both parts, effectively skipping the element at index.

katungiyassin
Автор

Thank you Brad. I watch your 1hr 30min intro to golang. And now I am watching this. It has brought me a long way. Here is a closure function to generate unique ids instead of the random.

//closure function to generate ids for book
func IdGenerator() func() int {
id := 1
return func() int {
id++
return id
}
}

var IdGen func() int = IdGenerator()

Thats how far I have come. Keep on.

levizwannah
Автор

This greatest tutorial I've ever seen and I've seen some bad ones can't understand voice, guys going hundred miles hour leaving shit out. You are truly gifted

joeyalfaro
Автор

I just want to say that you're the AWESOME! I really appreciate you're work, i think you're the best programming instructor on internet. To do all this tutorials for free, just priceless, GOD bless you! I learned so many things with you, thank you so much! Please never stop this videos, i study Computer Science at university, but i learned pretty much with you than at university:)

learning
Автор

it wasn't long, nicely paced and controlled depth of details.
Great video.
finally got my head around it a little.

saadabbasi
Автор

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.

JonBrookes
Автор

This is the most elegant language i've ever seen with 80 lines of code you've made a rest api, looking forward for more go-lang content :)

ristekostadinov
Автор

A second part would be awesomeeee. Thank you so much for your help! This helped a lot to start learning some things for a new job I started! :)

micaelatucker
Автор

You don't really need to import all the packages at the beginning, also you don't need to align types in your struct with tabs, go fmt does it for you which runs automatically when you save your code in vscode. You may have noticed (I did) that your extra unused imports went away as you saved your real code (not the hello world one) for first time. Anyway you said it in the beginning that you are new to golang so not to worry, it happens. Overall a good video for golang newbies.

BrutalHellfire
Автор

This was a terrific intro to Go and a basic REST api, please do more!

ClaraMcKenzie
Автор

32:53
When in tutorial someone says dont use this in production then we expect that you suggest what will be a better approach in just brief. Because we want to learn best practice in coding.

gameofcodes
Автор

This language looks so clean / so smooth and beatiful defintly going to try this. thank you brad for introducing me to something else besides javascript. I like what I'm seeing. As soon as you are ready for a full course in Udemy I will buy this course looking forward to more Go !

nlburnr
Автор

My notes so far:

1:30 - Were going to use http

2:30 - actually, were jumping straight to using a third party router instead of using the standard http lib

3:48 - $ = "money sign"

👌

lozD
Автор

Thank you sir. I have been programming professionally since 1999 in a multitude of different programming languages but mostly in the areas of web development and server Administration so PHP python Perl Ruby Etc. I recently started delving into Dart 2 and golang. Honestly go looked pretty easy but there were a lot of little things that I didn't quite understand and I really just want to jump right in and I feel like this video hit on some of the key things that I questioned but wasn't sure how to quickly learn through the tutorials and example code scattered around the web. I learn by example generally and usually by browsing code. I very much appreciate you taking the time to make this video tutorial it helped me grasp this quickly. Thank you.

TheHermitHacker
Автор

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

steveymcneckbeard
Автор

So you mention that you don't fully grasp slices when explaining the delete function, which may have changed by now, but for anyone watching, the gist of that delete line is:
- list[beginning:end] is a sublist of list from the indexes beginning to end
- so list[1:3] on a list like {1, 2, 3, 4} would give you a new list with the elements 1 and 2 (so, {2, 3}) of the original one (remember that indexes start at 0, and also the ending point is excluded from the sublist)
- If you don't put any index, the starting point defaults to 0, and the ending point defaults to the length of the list
- So books[:index] is "all books from the beginning to the index we got in the request" (excluding the last one of the sublist: the book we are deleting)
- And books[index+1:] is "all books from the book following the one we got from the request till the end"
- And then you're stitching these 2 sublists back together with append - omitting the book you are deleting

wk_dev
Автор

<3 Once I got the grasp of Golang, I havent used anything else for backend development.

znv