How To Structure Your Go App - Full Course [ Hex Arch + Tests ]

Поділитися
Вставка
  • Опубліковано 14 чер 2024
  • Learn how to structure your go/golang/go programming language applications using the #hexagonalarchitecture
    🌟 Hey devs! 🌟
    Ready to level up your coding game? Check out this awesome course on Microservices using Go!
    🚀 From beginner to pro, learn to build scalable apps with ease. Don't miss out!
    Enroll now: 👉 kantan-coding.teachable.com/p...
    #golanguage #Microservices #CodeWithConfidence 🔥🎉
    📚Learning Objectives: Hexagonal Architecture/ Ports & Adapters, Go Programming, gRPC, Docker, Docker Compose, Dependency Injection (DI), Inversion of Control (IoC), Unit Tests, End To End Tests
    👨🏽‍💻Code: github.com/selikapro/hexArchG...
    ⌨️ grpc_entrypoint.sh: github.com/selikapro/hexArchG...
    ☠️ Course Contents ☠️
    🔎 (0:00:00​) Intro
    🔎 (0:02:20​) What Is Hex Arch?
    🔎 (0:08:57​) Install Go
    🔎 (0:12:29​) Domain Layer
    🔎 (0:22:50​) Application Layer
    🔎 (0:31:05​) Framework Layer (Database)
    🔎 (0:46:25​) Framework Layer (gRPC)
    🔎 (0:48:32​) What Is gRPC?
    🔎 (0:51:20​) gRPC/Protoc - Install & Setup
    🔎 (1:02:10​) .proto files
    🔎 (1:17:25​) Framework Layer (gRPC) - Continued
    🔎 (1:35:50​) Bringing It All Together (main.go)
    🔎 (1:44:06​) Dependency Injection (DI)
    🔎 (1:45:32​) Visualizing Our Hex Arch Implementation
    🔎 (1:50:49​) What Is A Docker Container & Docker Compose?
    🔎 (1:54:46​) Install Docker
    🔎 (1:56:00​) Create Dockerfile
    🔎 (2:01:32​) Create Entrypoint File
    🔎 (2:04:36​) Create Docker Compose File
    🔎 (2:15:56​) Create SQL Script For Tests Table
    🔎 (2:17:01​) Add Unit Tests
    🔎 (2:22:02​) Add End To End Tests
    🔎 (2:37:07​) Running Tests Using Docker Compose
    🔎 (2:43:39​) Ending Notes
    🔎 (2:44:50​) Outro
    📚🤓 References:
    alistair.cockburn.us/hexagona...
    www.dossier-andreas.net/softwa...
    fideloper.com/hexagonal-archi...
    blog.gougousis.net/the-not-so...
    dzone.com/articles/hexagonal-...
    en.wikipedia.org/wiki/Hexagon...)
    • dotGo 2019 - Kat Zień ...
    netflixtechblog.com/ready-for...
    speakerdeck.com/fideloper/hex... Join the Discord to talk to me and the rest of the community!
    / discord

КОМЕНТАРІ • 169

  • @kantancoding
    @kantancoding  Місяць тому

    🌟 Hey devs! 🌟 Ready to level up your coding game? Check out this awesome course on Microservices using Go! 🚀 From beginner to pro, learn to build scalable apps with ease. Don't miss out! Enroll now 👉 kantan-coding.teachable.com/p/early-bird-special-pricing
    #GoLang #Microservices #CodeWithConfidence 🔥🎉

  • @mertozler290
    @mertozler290 2 роки тому +17

    I was introduced to Go 2 months ago and was having trouble finding resources. This video is great! It should reach more people, thank you for your efforts.

    • @kantancoding
      @kantancoding  2 роки тому +2

      Thanks a lot 🙏 I’m glad it helped you out!

  • @chungquantin
    @chungquantin 3 роки тому +37

    Wow!! This tutorial is so underrated. You deserve more recognition!

    • @kantancoding
      @kantancoding  3 роки тому +1

      Thank you for your kind words🙏 I’m glad that you liked it!

  • @coinnerd9633
    @coinnerd9633 3 роки тому +7

    Great to have you in this UA-cam community ! A lot of effort was put into this video , great

    • @kantancoding
      @kantancoding  3 роки тому +1

      Thank you! I’m glad that you liked it 😆

  • @pbznt
    @pbznt Рік тому +3

    This tutorial on hexagonal architecture is pure gold! As someone who comes from the PHP world and has experience building websites with my own MVC framework, I recently switched to Go and microservices and was struggling to find an effective way to structure my files. This tutorial provided me with a clear and concise approach to organizing my code. Thank you for sharing this valuable resource!

    • @kantancoding
      @kantancoding  Рік тому +1

      No problem! I’m glad that it helped you out. I too had a similar experience a few years back so it’s great to hear that this was helpful for you!

  • @michaelroof1969
    @michaelroof1969 2 роки тому +5

    Thorough explanation. Much more than the title says. Great work especially explaining GRPC. Give us more.. I have a love hate relationship with the pattern. Mainly hate the complexity and obscurity. Great vid. Thanks for sharing!

    • @kantancoding
      @kantancoding  2 роки тому +1

      Thank you for your feedback! I'm really glad you found it interesting 😀

  • @feynmaz
    @feynmaz Рік тому +2

    This is gold! Thank you for such a comprehensive tutorial

    • @kantancoding
      @kantancoding  Рік тому

      My pleasure! I’m glad you enjoyed 🙂

  • @alihavasi6972
    @alihavasi6972 2 роки тому +2

    A very good video. Excellent pace and direct delivery.
    Thanks a bunch.

    • @kantancoding
      @kantancoding  2 роки тому

      Thanks for your feedback. I’m really glad to hear that. That’s what I was hoping to achieve so I’m glad you think so 🙂

  • @2apoc
    @2apoc Рік тому +1

    Rewatching this video many times. Leaened much from it. Special thanks for gRPC testing and testing in docker compose

    • @kantancoding
      @kantancoding  Рік тому

      I'm really happy to hear that! I'm glad the time and effort I put into this video has been able to help so many people. More Go videos coming soon 😊

  • @cbaxtermusic
    @cbaxtermusic 2 роки тому +5

    This is a nice extension in domain-driven development. My services normally have the domain and application layer. introducing the framework layer is something I never thought to do.

  • @yarbersheer8559
    @yarbersheer8559 2 роки тому +2

    Full process tuts are the best ) Thank you so much!

  • @gitgyan5202
    @gitgyan5202 2 роки тому +1

    One of the best video I had seen about code architecture. Great explanation.

    • @kantancoding
      @kantancoding  2 роки тому +1

      Thank you very much. I’m happy to hear that! 😊

    • @gitgyan5202
      @gitgyan5202 2 роки тому

      @@kantancoding It's not just code architecture, the way you explained docker is also very much appreciated. Thanks for the knowledge. I wish you make more and more videos.

  • @sachinmaurya3259
    @sachinmaurya3259 3 роки тому +1

    Thank you for uploading this video...... I was looking to learn golang and this looks a perfect fit for that :)

    • @kantancoding
      @kantancoding  3 роки тому +1

      No problem! I hope that it helps you out 🙏

  • @RajaKhan-dc4vs
    @RajaKhan-dc4vs 10 місяців тому

    You are great man. I am glad that I have been able to discover your channel

    • @kantancoding
      @kantancoding  10 місяців тому

      Thank you! I’m happy to help. Thanks for your encouraging words 😊

  • @daniyarbaizhaksynov9230
    @daniyarbaizhaksynov9230 Рік тому

    Amazing i want to watch over and over, so clear and easy to reproduce

    • @kantancoding
      @kantancoding  Рік тому

      Glad you enjoyed it! Happy to help 🙂

  • @ffpedro
    @ffpedro 2 роки тому

    Thank you Kantan! Amazing tutorial!

    • @kantancoding
      @kantancoding  2 роки тому

      Thank you! I’m glad you liked it 🙏

  • @redazaza6312
    @redazaza6312 2 роки тому

    Very nice course, keep going!

  • @huesostorres
    @huesostorres 2 роки тому

    Thank you it was very helpful. Awsome tutorial!

    • @kantancoding
      @kantancoding  2 роки тому

      Thank you! I’m glad you enjoyed it 😆

  • @_mansoor
    @_mansoor 11 місяців тому

    Re-Watching it, thorough explanation. Thank you

    • @kantancoding
      @kantancoding  11 місяців тому

      Awesome to hear that you are rewatching. Thank you 😊

  • @TomDoesTech
    @TomDoesTech 2 роки тому +2

    Awesome tutorial! Subbed

    • @kantancoding
      @kantancoding  2 роки тому +1

      Thank you! I've been enjoying a couple of your tutorials as well

  • @gorangratte2471
    @gorangratte2471 2 роки тому

    You are a talented teacher! Very nice tutorial.

    • @kantancoding
      @kantancoding  2 роки тому

      Thank you 🙏 I’m glad you liked it 🙂

  • @vaibhavahuja4001
    @vaibhavahuja4001 2 роки тому

    very helpful. thanks for sharing

  • @cizor8616
    @cizor8616 Рік тому

    Thanks a lot! Really amazing!😀

    • @kantancoding
      @kantancoding  Рік тому

      Thank you! Really happy to see the effort is appreciated and helping others 😊

  • @AlfredLotsu
    @AlfredLotsu 10 місяців тому

    MAN, you are something special

    • @kantancoding
      @kantancoding  10 місяців тому

      Thanks for your kind words 😊 I’m happy to help!

  • @taneja_unchained
    @taneja_unchained 10 місяців тому +1

    My brother, this is going to be one fo the best tutorial chanel. Your delivery, coding skills and fluff free clean curriculum is commendable. Would love to work with you sometime :)

    • @kantancoding
      @kantancoding  10 місяців тому +1

      Hey bro. Thank you for your kind feedback! I’m really happy that my videos are able to help you out 😊

  • @thebluespecs
    @thebluespecs 2 роки тому

    You earned a sub in the first 5 mins of this video. +1 from another gruvbox user.

  • @shanglee643
    @shanglee643 2 роки тому

    bless you man!

  • @hooktest8101
    @hooktest8101 2 роки тому

    Really amazing tutorial 👍

    • @kantancoding
      @kantancoding  2 роки тому

      Thank you! I’m glad you think so 🙂

  • @ADMIREZable
    @ADMIREZable 2 роки тому

    Thanks a lot for this great tutorial

  • @klamberext
    @klamberext Рік тому

    I would edit some typing out. Implementing addition and watching/waiting for the copy paste distracts heavily from the topic.
    Also can use a shorter interface as an example.
    Great vid in general :)

  • @abhijithbinoy875
    @abhijithbinoy875 Рік тому

    awesome thanks for the video ❤

  • @ayyubayyyub9415
    @ayyubayyyub9415 2 роки тому

    Excellent, please don't give up you are doing very good job.

    • @kantancoding
      @kantancoding  2 роки тому

      Thanks for the encouragement!

    • @ayyubayyyub9415
      @ayyubayyyub9415 2 роки тому

      @@kantancoding Bro Golang is becoming popular I am glad you got in this train right now because right now and in the future you will be recognized as on of the best developer instructor on youtube of golang.

    • @ayyubayyyub9415
      @ayyubayyyub9415 2 роки тому

      Please make a video advising developer like me to focus on frameworks and libraries to focus on to build things not non popular maintained ones, because it can be confusing because Golang is relatively a new Language thank you.

  • @smann43231816
    @smann43231816 2 роки тому

    Great tutorial

  • @prashlovessamosa
    @prashlovessamosa Рік тому

    Thank you

  • @nickyyyyy
    @nickyyyyy 2 роки тому +1

    Thanks for the video.
    I am wondering though, shouldn't the domain be the one to operate the persistance layer?

    • @kantancoding
      @kantancoding  2 роки тому

      No problem! Can you elaborate a bit on your thought process?

  • @lotfikamel5947
    @lotfikamel5947 Рік тому

    Subscribed 🎉

  • @Studykaro-ko8zn
    @Studykaro-ko8zn 17 днів тому

    doing god's work🙏

  • @CosasCotidianas
    @CosasCotidianas Рік тому

    I'll probably receive a lot of negative feedback, but from my humble opinion, hexagonal architecture is the healthiest way to implement DDD without failing. Cool video BTW! (and subscribed)
    Also after zooming out at 36:00 looks better for me.

    • @kantancoding
      @kantancoding  Рік тому

      Thank you for your feedback! I’m glad that the video was helpful 🙂

  • @MegaHarko
    @MegaHarko 2 роки тому

    Half way through and so far it was an enjoyable ride :)
    But since this cost me a bit of time I just have to ask:
    What's the version of protoc-gen-go-grpc you used? When I followed along I had to embed an UnimplementedArithmeticServiceServer into the rpc-Adapter-struct. Sadly (and unlike protoc and protoc-gen-go) that version isn't saved into the generated code. But I'm wondering since the other protoc-tools versions matched and I didn't see you using require_unimplemented_servers=false...

    • @kantancoding
      @kantancoding  2 роки тому

      I actually don't remember what version I was using as I made this tutorial many moons ago 😂. But when you say you embed an UnimplementedArithmeticServiceServer do you mean that you are hardcoding it into the generated code? When you run the protoc command you should be able to do something like this --go-grpc_out=require_unimplemented_servers=false:.....

    • @MegaHarko
      @MegaHarko 2 роки тому

      @@kantancoding ouch :D I shouldn't have stopped watching. 5 minutes later you explain all that

  • @dilungasr1322
    @dilungasr1322 4 місяці тому +1

    Great tutorial bro! Much love from Tanzania 🇹🇿. One question though, can’t we jus write the db retry logic in the app instead of having a separate sh script?

    • @kantancoding
      @kantancoding  4 місяці тому

      Hey thanks for watching! I think there are many ways to skin a cat 😂

  • @JoyantoGhoshJG
    @JoyantoGhoshJG Рік тому

    Firstly, thank you so much for your time and effort in making such an illustrative video.
    I followed your inputs and developed a RESTful application however got confused a bit. Can you give a pointer by creating same application replacing grpc with http?

    • @kantancoding
      @kantancoding  Рік тому

      Thank you, I’m glad you liked it 🙂 You can just add an additional interface using pkg.go.dev/net/http. Hope it helps!

  • @Hector-Site
    @Hector-Site 2 роки тому

    One like for detailed walkthrough and another like for mastering Vi in 2021 👍

  • @MangoFlamingo
    @MangoFlamingo Рік тому

    Good stuff

  • @melromero2665
    @melromero2665 3 роки тому

    Awesome, I love u

  • @entanglesoftware6535
    @entanglesoftware6535 2 роки тому

    Hi Kantan, It was amazing video over the domain driven approach hex architecture microservices. Awesome !!
    Can you please share your vim settings to get those autocomplete and nice display ?

    • @kantancoding
      @kantancoding  2 роки тому +1

      Thanks! Glad you liked it! Here's a video I made explaining my vim setup: ua-cam.com/video/mbSaK3EOqO8/v-deo.html

    • @entanglesoftware6535
      @entanglesoftware6535 2 роки тому

      @@kantancoding Thanks Kantan !! Appreciate you man !

    • @entanglesoftware6535
      @entanglesoftware6535 2 роки тому

      @@kantancoding Sorry for troubling you, but the structure that you followed in the video doesn't match up with the git repo that you shared above. Is it possible for you to update the repo with the latest changes ? I see a lot of differences in there. Once again, awesome work man !! This is a piece of art beautifully explained !!

    • @entanglesoftware6535
      @entanglesoftware6535 2 роки тому +1

      dbaseDriver := os.Getenv("DB_DRIVER")
      dsourceName := os.Getenv("DS_NAME")
      dbAdapter, err := db.NewAdapter(dbaseDriver, dsourceName)
      Regarding the above, it would be quite good if these variables are resolved into the NewAdapter function because other databases can have different configuration and requirement like mongodb, sql, redis etc. I know it's just demo but if anybody got confuses, i would like to point above one.
      Please correct me if i am wrong.

  • @SirJagerYT
    @SirJagerYT Рік тому +1

    For Self Reference
    8:36 Project Structure

  • @bralabala
    @bralabala 2 роки тому

    Thank you...

  • @ruiuniver4
    @ruiuniver4 Рік тому

    what is ur Linux distribution and what is ur monitor?

  • @soh0001
    @soh0001 2 роки тому

    Hey Thanks for sharing this video. while I'm watching this video, I'm also very interesting in your vimrc. could you share how did you config your vimrc for changing the status on VIM bottom while being Normal mode or Insert mode

    • @kantancoding
      @kantancoding  2 роки тому

      Thank you 🙏 I have a video where I explain my whole vim setup here: ua-cam.com/video/mbSaK3EOqO8/v-deo.html

  • @simo_the_goat
    @simo_the_goat 6 днів тому

    You're the best

  • @armin8016
    @armin8016 Рік тому

    grate video!! there aren't many go projects with this quality
    why did you use vim instead of something like vs-code?

    • @kantancoding
      @kantancoding  Рік тому

      Thanks! I’m glad you liked it. I use vim for most small projects because it’s less cumbersome/faster than an IDE and half of the IDE features I don’t use when working on small projects.
      For work/large projects I use an IDE 👌

  • @raihankhanraka9703
    @raihankhanraka9703 2 роки тому

    May I know which terminal / theme do you use? looks stunning!

    • @kantancoding
      @kantancoding  2 роки тому

      I use iterm2 and my color scheme is custom. You can configure custom schemes in the iterm2 settings. Just google iterm2 color schemes.

  • @jinnzhu768
    @jinnzhu768 Рік тому

    Thanks for the nice lecture! By the way, what's the font name of your terminal?

    • @kantancoding
      @kantancoding  Рік тому

      I actually forgot the name but it’s in the video on my channel about how to set up your terminal 😉

  • @vyomsharma1840
    @vyomsharma1840 Рік тому

    is this entire video one project or tutorials on different sections? also if it is one project, what does the application do?

  • @adamchilicki4409
    @adamchilicki4409 9 місяців тому

    If i wanted to have multiple db's (mongo/postgres/..etc) would I just change the 'type Adapter' to type MongoAdapter/PostgresAdapter? same with NewAdapter->NewPostgres/NewMongo

  • @maximilianososa9033
    @maximilianososa9033 Рік тому

    Is the database injected directly into the application layer? It doesn't go through the framework layer? Excellent video!

    • @maximilianososa9033
      @maximilianososa9033 Рік тому

      It's like application layer depends on framework and core... I don't get it

    • @kantancoding
      @kantancoding  Рік тому +1

      Hmm, so basically, you can see exactly which layers depend on which layers from the main.go file by looking at what is being injected where. It’s actually quite difficult to comprehend in the beginning but I think you are closer to understanding it than you think! I think this is a tutorial that you might have to watch certain parts more than once 😉

  • @shaquilenoor5223
    @shaquilenoor5223 2 роки тому

    How should someone fit something like bi-directional streaming into their hexagonal architecture ? given that it streams both ways.

    • @kantancoding
      @kantancoding  2 роки тому +1

      If a particular architecture doesn’t go well with your use case, it’s usually better to consider other options as well. This isn’t a one size fits all architecture imo.

  • @balanceresume2802
    @balanceresume2802 2 роки тому

    recommended I would like this🤩 Much better than most paid courses out there. 👌👌👏

  • @pierrebd77
    @pierrebd77 Рік тому +1

    I really love your tutorial!! I was looking for some good implementation of clean architecture or hex architecture and this One is so good!!
    But... I have a question, you say: "We dont want inner layer to depend to outer layers.". So I dont understand why the app layer depend on dB witch is on outerlayer. We just need to do dependency injection in order to pass throught this limitation or maybe I misunderstood something? :)
    Edit: ok I think I understand, instead of making outerlayer depend on innerlayer, we are just using dependency injection everywhere.
    In this case how is the dependency of an outerlayer on an innerlayer represented in the code?
    This question prevents me from using clean architecture or hexagonal architecture in good conscience 😅

    • @kantancoding
      @kantancoding  Рік тому +2

      When an outer layer imports an inner layer package and makes use of it to do what it needs to do then it depends on that inner layer. If that inner package is removed then the outer layer would break therefore it depends on that inner layer. Is that what you are asking?

    • @pierrebd77
      @pierrebd77 Рік тому

      @@kantancoding Okay, thanks! I think I understand :)

  • @naehalmulazim
    @naehalmulazim Рік тому

    Instant subscription.
    Althoughhhh...maybe the folders are a bit much? I mean, I understand we need them for different Go packages but still...

    • @kantancoding
      @kantancoding  Рік тому +1

      haha, I'm a bit of a folder addict. I just like things to be compartmentalized. The folder structure is somewhat flexible in my opinion so feel free to change it in a way that makes the most sense to you.

    • @naehalmulazim
      @naehalmulazim Рік тому

      @@kantancoding Thanks for the reply! When I went through my followed-along version again, I found it helpful in remembering the roles of everything, so YES!

  • @ivorybanana2183
    @ivorybanana2183 5 місяців тому

    what is your theme? I wanna try it out myself, looks like some kind of soft gruvbox variant :)

  • @Shri
    @Shri Рік тому

    Shouldn't the app and core directories be outside the adapters directory?

    • @kantancoding
      @kantancoding  Рік тому +1

      The directory structure isn’t set in stone. I think, use this as a guide but discuss with your team parts that you might want to change to fit the needs of your project.

  • @kacpereczynski613
    @kacpereczynski613 Рік тому

    Hello, awesome video, keep going with this :) I have a question. Any sugestion about mac with apple silicon M1 pro ? I have errors with sh script and i cannot deal with it :/

    • @kantancoding
      @kantancoding  Рік тому

      Thank you! Glad it helped. What are the errors?

    • @kacpereczynski613
      @kacpereczynski613 Рік тому

      @@kantancoding Thank you for your response, I cannot send any images in comment section, so I send you image via instagram :)

    • @kantancoding
      @kantancoding  Рік тому

      @@kacpereczynski613 it’s better if you join the Discord and ask your question there so that others that run into a similar problem can see the discussion 🙂

    • @kacpereczynski613
      @kacpereczynski613 Рік тому

      @@kantancoding Sounds good, where i can find any link to discord ? :)

    • @kantancoding
      @kantancoding  Рік тому

      @@kacpereczynski613 If you go to my channel page and select the Community tab, it should be in the top post

  • @taneja_unchained
    @taneja_unchained 10 місяців тому

    When i generated rpc server via proto it does not have any handlers or register server function

  • @taneja_unchained
    @taneja_unchained 10 місяців тому

    Bro can you please make a video series on using vim as a code editor / IDE and why this would be better than using full bloen IDEs like jetbrains products? Would really appreciate it

    • @kantancoding
      @kantancoding  10 місяців тому +2

      Actually, using the text editor vim lacks many of the out of the box features provided by IDEs. You can have a pretty feature rich vim setup but it takes a lot of configuration.
      I actually don’t think one option is better than the other. I use vs code and jetbrains products with vim plugins every day and they make my life easier.
      I also use vim over an IDE in many situations as well. It really depends on what I’m working on.
      For Java I heavily depend on IntelliJ. For Go I usually just use vim. So yeah, just use whatever tool makes you the most productive. I’m not part of any camp and I don’t advocate for either. They’re just tools to me.
      I will say that learning vim will definitely increase your productivity regardless of if you use it in an IDE or in the normal text editor.

  • @ishikanagar3053
    @ishikanagar3053 10 місяців тому

    Hi, I am just getting started with GO, I have learned the basics of it and currently searching for resources to get more hands-on with it, Is this tutorial suitable for beginners to get a better understanding and hands-on with GO?

    • @kantancoding
      @kantancoding  10 місяців тому

      Hey what’s up! Honestly, just try and go through it. There are many different types of beginners. I try to explain everything in detail but I can’t really give you a for sure answer about whether or not you can handle this course because I don’t know your exact level. If you struggle after the first hour then maybe you need to try some more beginner friendly material.
      I have a beginner friendly video that will walk you though making a payment processing backend. It’s called introduction to programming using Go. I think you should try that one as well.

    • @ishikanagar3053
      @ishikanagar3053 10 місяців тому

      @@kantancoding definitely, I will go with your advise...thanks for replying though! BTW I really admire your teaching skills, I finally understood time complexity after watching your videos, I wish I could be as good as you are in terms of coding.

    • @kantancoding
      @kantancoding  10 місяців тому +1

      😂 I know many people that are much better than me. Just keep at it and you will get there in no time! Also, thank you for the feedback. I really am happy to hear that 😊

  • @arthurneto1307
    @arthurneto1307 Рік тому

    Hello my brother, how are you? Man, are you use VIM or NEOVIM to code?

    • @kantancoding
      @kantancoding  Рік тому +1

      What’s up bro. I’m using vim 😎

    • @arthurneto1307
      @arthurneto1307 Рік тому

      ​@@kantancoding Ooooooh my Gosh, I found your .vimrc config on your GitHub, thanks so much for sharing.

    • @kantancoding
      @kantancoding  Рік тому +1

      @@arthurneto1307 no problem. I also have a video on how to set it up😉

  • @bavan1358
    @bavan1358 2 роки тому +1

    hello sir,
    can you please make a dsa playlist for golang

    • @kantancoding
      @kantancoding  2 роки тому

      Hello sir. You will find that when it comes to DSA, there is really no difference between languages. For example, here is binary search in Go:
      package main
      import "fmt"
      func main() {
      fmt.Println(binarySearch([]int{-1, 0, 3, 5, 9, 12}, 3))
      }
      func binarySearch(nums []int, target int) int {
      start := 0
      end := len(nums) - 1
      for start target {
      end = mid - 1
      }
      }
      return -1
      }
      And here is binary search in Python:
      def binarySearch(nums, target):
      start = 0
      end = len(nums) - 1
      while start target:
      end = mid - 1
      return -1
      if __name__ == "__main__":
      print(binarySearch([-1, 0, 3, 5, 9, 12], 3))
      As you can see, the algorithms are exactly the same. The only difference is language syntax. You will also notice that if you can read one, you can read the other. So when learning dsa, don't worry so much about the language being used. If you find materials, that are helpful that use a different language from the language you're most comfortable with, odds are you can still understand the material if the teacher is doing what he/she is supposed to be doing.

  • @ralphguichette9952
    @ralphguichette9952 Рік тому

    Is there a book I can use or another resource I can use to learn this? The tutorial is pretty good and I'm still having trouble following the "why" of what we're doing. I feel like I'm just following steps without understanding anything. Again, not your fault. I just can't follow things without really understanding the deep "why" between each step.

    • @kantancoding
      @kantancoding  Рік тому

      I think maybe this might be a bit advanced for you in that case. It’s hard to say without knowing what parts in particular you are having a difficult time understanding. Maybe I can make some suggestions if you provide that info 🙂

    • @ralphguichette9952
      @ralphguichette9952 Рік тому

      @@kantancoding I just didn't understand the naming conventions and what they really meant or why they were needed. After some time, I think I'm ready to try this video again. Thank you for the reply!

  • @pmpjim
    @pmpjim 2 роки тому

    Curious why don't use pointer for receivers?

    • @kantancoding
      @kantancoding  2 роки тому

      Hey, what’s your question exactly? There are many things I didn’t use including go routines.

  • @yasirkaram
    @yasirkaram 2 роки тому

    Amazing tutorial, but seemed that you changed the architecture a bit in the repo to separate application layer

    • @kantancoding
      @kantancoding  2 роки тому

      Thank you! Here’s the video that explains the change in the architecture:
      ua-cam.com/video/C-GBzD5Qk2A/v-deo.html

    • @yasirkaram
      @yasirkaram 2 роки тому

      @@kantancoding Cheers

  • @asiix9164
    @asiix9164 2 роки тому +1

    What would the structure look like if structs were involved? For instance, what would a port interface look like if a method signature consumes a struct? Would the struct type go inside the ports package? I'm assuming it would since it would be odd (imo) to import a struct type from the framework layer back up to the port layers. As you mentioned, everything should be going inwards. At the same time, importing structs from the ports package also seems a bit strange because of the naming. For example, ports.Arithmetic{op Operator, result int} -- this struct would be best inside the core arithmetic package, but again, you'd have to import "upward" if you needed to make a method signature in the ports interfaces that consumed this struct. Maybe I'm missing a better design here, but that's the only con I can see here, what are your thoughts on how to do this?

    • @kantancoding
      @kantancoding  2 роки тому +1

      In my opinion, if port interfaces have method signatures that consume structs that separate layers depend on, then the layers are no longer loosely coupled which kind of defeats the purpose. What you decide to do really depends on the requirements of your application but a simple way to deal with it would be to avoid using structs between layers and instead make use of Go’s basic types.

  • @user-yf5fd7cb3r
    @user-yf5fd7cb3r Рік тому +1

    Isnt there a mistake?
    Database should be on the framework layer. App uses its port and violates the dependency direction principle.

    • @kantancoding
      @kantancoding  Рік тому

      I’ve never heard of the dependency direction principle but I think you should watch the part where I explain how we’re using dependency injection to ensure that the dependencies point inward.
      Also, you should rewatch the part that explains how we’re using interfaces (abstractions) to expose the behavior needed between layers.

    • @user-yf5fd7cb3r
      @user-yf5fd7cb3r Рік тому

      @@kantancoding It was a typo, I meant dependency inversion principle. And yes, I understand now. We define the interfaces at the lower level. The lower level defines the way how the outer details should behave. I think, this is a good way.

  • @Naton
    @Naton 2 роки тому

    why does your vim have an extra UI/Command line?
    INSERT
    -- INSERT --

    • @kantancoding
      @kantancoding  2 роки тому

      I have a video that explains my vim setup here: ua-cam.com/video/mbSaK3EOqO8/v-deo.html

  • @abdullahwaqar3024
    @abdullahwaqar3024 3 роки тому

    please start data structures and algorithms course

    • @kantancoding
      @kantancoding  3 роки тому

      Hello! Have you checked out my series that teaches data structures through building an API using Flask and Python? ua-cam.com/play/PL7g1jYj15RUP_Mri9ym6BdUais6_jvhrS.html

    • @abdullahwaqar3024
      @abdullahwaqar3024 3 роки тому

      @@kantancoding yes i checked but please upload more videos if you have time.

  • @risabhable
    @risabhable 2 роки тому

    the content is really nice, but can you please remake the tutorial if possible, as it would be a hassle for watching update video and understanding the same.

    • @kantancoding
      @kantancoding  2 роки тому +2

      Thank you! Sorry, but I am going to have to say no to this request.

  • @davida.7586
    @davida.7586 2 роки тому

    Heh! Talking like a bot!

  • @Alex-hr2df
    @Alex-hr2df 10 місяців тому

    The title is "how to structure". The video is "how to code". Sigh!