Learning Golang: Dependencies, Modules and How to manage Packages

11585
34
260
25.05.2021
Mario Carrion

Mario Carrion

322558
7500
95
01.07.2007
US
Описание видео:

Welcome! Let's learn about Go Modules! What is a "Go Module"? A module is a collection of Go packages stored in a file tree with a "go.mod" file at its root. This file defines: * Module path: indicates how our package will be imported by our users, and * Dependency Requirements, indicate the packages we depend on. "Dependency Requirements" not only covers the actual packages but also ways to "Replace" or "Exclude" them, using the corresponding directives: * Replace: allows replacing a version of a dependency with another one, for example in cases where local deployment is still happening or when working for forked versions; and * Exclude: allows excluding a version of a dependency from use, for example in cases those versions include security issues or bugs. "Go Modules" were introduced in Go 1.11 and enabled by default in Go 1.16, they use "Semantic Versioning" (SemVer) as the main versioning system, were versions are defined using three numbers: Major.Minor.Patch. The Go toolchain allows interacting with Modules via the "mod" command, but not only that other commands like "get" or "build" are also compatible with Go Modules, the most used commands are: * "go mod init" to initialize a module, for example "go mod init github.com/MarioCarrion/example-pkg" * "go get _package/version_🤍_specific-version_" go get packages with specific version, for example "go get github.com/jackc/pgx/v4🤍v4.10.1" * "go get" can be used to upgrade or downgrade as well, for example to downgrade: "go get github.com/jackc/pgx/v4🤍v4.10.0" or update to latest "go get -u github.com/jackc/pgx/v4" * "go mod tidy" to remove unused dependencies. - * "The Go Blog: Using Go Modules" 🤍blog.golang.org/using-go-modules Real life examples of versioning Go Modules: * Using module path: 🤍github.com/googleapis/gax-go * Using branches: 🤍github.com/olivere/elastic Tools: * 🤍github.com/oligot/go-mod-upgrade: Update outdated Go dependencies interactively * 🤍github.com/marwan-at-work/mod: Automated Semantic Import Versioning Upgrades - * Previous Episode: "Golang Tutorial: Context package: Cancellations, Deadlines and Request-scoped values": 🤍youtu.be/mgJMIZsWfB4 * Blog: 🤍mariocarrion.com/2021/06/07/learning-golang-dependencies-modules.html * Playlist "Learning Golang": 🤍🤍youtube.com/playlist?list=PL7yAAGMOat_F7bOImcjx4ZnCtfyNEqzCy * Playlist "Building Microservices in Go/Golang": 🤍🤍youtube.com/playlist?list=PL7yAAGMOat_Fn8sAXIk0WyBfK_sT1pohu * Playlist "Golang Tools and Packages": 🤍🤍youtube.com/playlist?list=PL7yAAGMOat_HEEOvH99agDs_5g51A0Ls3 * Playlist "Testing in Go": 🤍🤍youtube.com/playlist?list=PL7yAAGMOat_HSeW4zF0uRL9EaHadE4ZZq 00:00 - Start 00:08 - What is a Go Module? 01:09 - go.mod? require? replace? exclude? 02:12 - go.mod in real life 02:36 - go.mod indirect? 03:06 - go.sum 03:58 - Versioning Go Modules: Path or Branch 05:29 - Demo, go mod init 08:59 - Module upgrade and downgrade 13:18 - Requesting available updates 14:19 - Versioning: Real life examples 15:26 - Go Modules: Conclusion and parting words - Who am I: Hello👋🏼! I'm Mario, a Hands-on Software Architect and Lead Backend Engineer with more than 16 years of professional experience building all kinds of software including on-premise Industrial Automation Systems, Linux Accessibility Desktop and Browser Components as well as Distributed Advertising Microservices. Every week I will share with you different topics I've learned while working for small startups and large companies including the processes I've followed over the years for successfully delivering complex enterprise systems from start to end. Subscribe if you like Software Development, Software Architecture and Systems Design! Keep it up. Don't give up! #golang #tutorial #programming - Our affiliate links below Shop our favorite products → 🤍🤍amazon.com/shop/rubycarrion Vlogging setup → 🤍rubycarrion.com/camerasforvlogging/ Get a 30 day FREE trial of Epidemic Sound → 🤍🤍epidemicsound.com/referral/szx441/ Try Amazon Prime 30-Day FREE trial → 🤍amzn.to/3s0el1R I love getting Cash Back and think you will too! Join for free and get $20 when you spend $20 → 🤍🤍rakuten.com/r/RUBYRA132?eeid=28187 Sign up to start using vidIQ to grow your YouTube channel for FREE → 🤍vidiq.com/rubycarrion - Our Vlog Channel 🤍🤍youtube.com/c/RubyCarrion/videos

Кадры из видео
Learning Golang: Dependencies, Modules and How to manage Packages
Learning Golang: Dependencies, Modules and How to manage Packages
Learning Golang: Dependencies, Modules and How to manage Packages
Learning Golang: Dependencies, Modules and How to manage Packages
Тэги из видео
Комментарии пользователей:
luq 233
2022-04-23 13:25:33

awesome and excellent explanation!!!! THX!!!!!🥰🥰🥰🥰🥰🥰

Xepherina
2022-04-03 17:55:30

This is a very detailed explaination for go modules! thank you very much! although I have a question, If youre using branches as versions of the module how would you manage it if you are merging it with the main branch?

Pedro Henrique
2022-03-29 11:32:51

Thank you so much!!! Your videos are helping me a lot!!

Jason Jiang
2022-03-21 13:32:12

This is extremely useful! Thank you so much for the tutorial!

Rahul SriRam
2022-02-01 08:23:31

I found this gem of a channel today and I can't stop binging

Proud Indian
2022-01-29 14:26:20

Nice tutorial..!! Thanks

ultium labs
2021-12-13 06:36:10

thanks, it clarifies something I don't understand before.

MegaSovietRussian
2021-12-01 13:41:26

Excellent delivery! thank you so much for the tutorial:)

Marcello Lins
2021-11-23 23:02:44

Incredibly useful video ! Thanks for helping demystify something that turned out to be quite simple

Jim Zhu
2021-09-25 13:37:52

very clear, thank you sir.

liminal
2021-08-15 03:03:36

Excellent. Thank you.

Srini R
2021-08-13 06:25:30

Thanks for the explanation. What is vendor and go mod vendor and vendor folder.

Jackedelic
2021-07-12 13:24:14

What if my dependencies are private repo? How can we configure go mod such that it knows our ssh private key in order to access the private repos?

Ha Do Nguyen
2021-05-25 21:59:56

thank you

jose vitor morais
2021-05-25 14:05:04

Olá Mario tudo bem? Espero que sim.. falo aqui do Brasil, queria agradecer pelo conteúdo que está disponibilizando no seu canal, sou novo no mundo GOLANG, e seus vídeos são excelentes, ensinando muita coisa que é realmente usado no mercado..atualmente trabalho com nodejs, e tudo q vc ensina aqui eu utilizo com node no dia a dia... parabéns pela didática, suas explicações são ótimas e concisas, espero que continue com o trabalho, sucesso e tudo de bom pra você..

Mario Carrion
2021-05-25 11:24:36

Blog mariocarrion.com/ mariocarrion.com/

Learning Golang youtube.com/playlist?list=PL7yAAGMOat_F7bOImcjx4ZnCtfyNEqzCy youtube.com/playlist?list=PL7yAAGMOat_F7bOImcjx4ZnCtfyNEqzCy
Building Microservices in Go youtube.com/playlist?list=PL7yAAGMOat_Fn8sAXIk0WyBfK_sT1pohu youtube.com/playlist?list=PL7yAAGMOat_Fn8sAXIk0WyBfK_sT1pohu
Go Tools and Packages youtube.com/playlist?list=PL7yAAGMOat_HEEOvH99agDs_5g51A0Ls3 youtube.com/playlist?list=PL7yAAGMOat_HEEOvH99agDs_5g51A0Ls3
Testing in Go youtube.com/playlist?list=PL7yAAGMOat_HSeW4zF0uRL9EaHadE4ZZq youtube.com/playlist?list=PL7yAAGMOat_HSeW4zF0uRL9EaHadE4ZZq

Keep it up!

Joseph Michael
2021-05-25 11:22:54

First 🚀🚀

Что ищут прямо сейчас
Fé No Pai zinga al aqsa nigerian agence nocode Golang package Spo Black Shark 5 5G police car swamps learn soldering armenian Prva Srbija DİY golang developer online nid info Y.A.S. GEMINI 5K Fam lee Hanee marcus aurelius
Похожие видео
21.11.2021
GoLang Packages and Modules | Beginners Go Tutorial

GoLang Packages and Modules | Beginners Go Tutorial

14.11.2018
justforfunc #42: Intro to Go Modules and SemVer

justforfunc #42: Intro to Go Modules and SemVer

13.04.2020
EVERYTHING You SHOULD know about Go Modules (Go Basics #8)

EVERYTHING You SHOULD know about Go Modules (Go Basics #8)

03.02.2022
gRPC vs GraphQL vs REST? What's the best API Technology for Golang?

gRPC vs GraphQL vs REST? What's the best API Technology for Golang?

05.11.2021
Learning Golang: Functional Options / Default Configuration Values Pattern

Learning Golang: Functional Options / Default Configuration Values Pattern

16.04.2022
How I Would Learn To Code (If I Could Start Over)

How I Would Learn To Code (If I Could Start Over)

17.12.2021
Golang Package Structure Explained in 7 Minutes

Golang Package Structure Explained in 7 Minutes

19.11.2021
Learning Golang: Relational Databases - Introduction to database/sql

Learning Golang: Relational Databases - Introduction to database/sql

08.10.2021
Software Architecture in Golang: Security - Dependencies

Software Architecture in Golang: Security - Dependencies

27.02.2022
Goroutines and Channels | Learn Concurrency in Go

Goroutines and Channels | Learn Concurrency in Go

15.12.2021
Golang Tutorial for Beginners | Full Go Course

Golang Tutorial for Beginners | Full Go Course

05.06.2021
Software Architecture in Golang: C4 Model for Diagraming and Documentation

Software Architecture in Golang: C4 Model for Diagraming and Documentation

07.05.2021
Learning Golang: Context package: Cancellations, Deadlines and Request-scoped values

Learning Golang: Context package: Cancellations, Deadlines and Request-scoped values

26.07.2021
golang project structure

golang project structure

12.07.2021
I QUIT My $120,000 Job After Learning 3 Things

I QUIT My $120,000 Job After Learning 3 Things

23.10.2019
Packages in Go (Go Basics #6)

Packages in Go (Go Basics #6)