How to Create Library and Import it Locally in Go (Golang) #go #golang #library



How to Create Library and Import it Locally in Go (Golang) #go #golang #library

How to Create Library and Import it Locally in Go (Golang) #go #golang #library

In this video, we will discuss how to use external libraries in our project and create a library in Go and use it locally. Also, where we can find go packages. How to use mod tidy command. What does replace mean, and much more?
#library #go #golang #coding #programming #learning #tutorial

Link to my blog post: https://zoranstankovic.com/how-to-create-library-and-import-it-locally-in-go-golang/

Resources:
https://go.dev/doc/code
https://go.dev/doc/tutorial/call-module-code
https://go.dev/ref/mod#go-mod-tidy
https://go.dev/doc/modules/gomod-ref#replacement
https://go.dev/doc/tutorial/create-module
https://pkg.go.dev/rsc.io/quote/v4

Chapters:
0:00 Intro
0:13 Packages recap
0:43 Two types of packages
1:06 Workflow
1:37 Create hello project
2:49 External Packages
3:33 go mod tidy command
4:00 Go package folder structure
4:43 quote package documentation
4:59 Use of quote package
5:25 Create a local calculator library
7:35 Import the local calculator library in the hello project
7:59 replace statement
9:11 go mod edit -replace command
10:00 go mod tidy command to import local library
10:40 Use calculator package
11:20 Outro

đź“Ł Please leave a LIKE and SUBSCRIBE for more content! đź“Ł

Follow me on:
🌍Website: https://zoranstankovic.com
📱Twitter: https://twitter.com/RyunosukeZoran
đź”—Github: https://github.com/zoranstankovic