[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"academy-blogs-en-1-1-all-go-modules-managing-dependency-all--*":3,"academy-blog-translations-xpyoxp3xxzqrzkk":74},{"data":4,"page":62,"perPage":62,"totalItems":62,"totalPages":62},[5],{"alt":6,"collectionId":7,"collectionName":8,"content":9,"cover_image":10,"cover_image_path":11,"created":12,"created_by":13,"expand":14,"id":68,"keywords":69,"locale":44,"published_at":70,"scheduled_at":13,"school_blog":66,"short_description":71,"slug":72,"status":64,"title":6,"updated":73,"updated_by":13,"views":67},"EP.11 Go and Modules: Managing Dependency Professionally","sclblg987654321","school_blog_translations","\u003Cp>\u003Cspan style=\"font-size:20px;\">\u003Cstrong>Go and Modules: Managing Dependency Professionally\u003C\u002Fstrong>\u003C\u002Fspan>\u003C\u002Fp>\u003Cp>No more headaches with manually installing packages! Today, we will guide you through using Go Modules, which will help keep your project organized and ready for full development.\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>\u003Cspan style=\"font-size:18px;\">\u003Cstrong>1. What are Go Modules?\u003C\u002Fstrong>\u003C\u002Fspan>\u003Cbr>Go Modules allow you to manage packages and dependencies efficiently, eliminating the need to worry about manually installing library files.\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>\u003Cspan style=\"font-size:18px;\">\u003Cstrong>2. Getting Started with Go Modules\u003C\u002Fstrong>\u003C\u002Fspan>\u003Cbr>When you create a new project, use this command to generate a go.mod file:\u003C\u002Fp>\u003Cpre>\u003Ccode class=\"language-plaintext\">go mod init myapp\n\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>The go.mod file will store the main module of your project, along with the various dependencies you will need.\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>\u003Cspan style=\"font-size:18px;\">\u003Cstrong>3. Installing External Packages with go get\u003C\u002Fstrong>\u003C\u002Fspan>\u003Cbr>Suppose you want to install a web framework called Gin. Use the command:\u003C\u002Fp>\u003Cpre>\u003Ccode class=\"language-plaintext\">go get github.com\u002Fgin-gonic\u002Fgin\r\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>When you run this command, the package information will be added to go.mod, and the necessary files will be downloaded to your machine.\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>\u003Cspan style=\"font-size:18px;\">\u003Cstrong>4. Updating and Managing Dependencies\u003C\u002Fstrong>\u003C\u002Fspan>\u003Cbr>Go has a clear version management system for modules, such as:\u003C\u002Fp>\u003Cpre>\u003Ccode class=\"language-plaintext\">go get -u github.com\u002Fgin-gonic\u002Fgin\r\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>Locking the dependency versions you want in go.mod to reduce the risk of unintended updates.\u003C\u002Fp>\u003Cp>&nbsp;\u003C\u002Fp>\u003Cp>\u003Cspan style=\"font-size:18px;\">\u003Cstrong>5. Running a Project that Uses Go Modules\u003C\u002Fstrong>\u003C\u002Fspan>\u003Cbr>After successfully installing the modules, run your project with:\u003C\u002Fp>\u003Cpre>\u003Ccode class=\"language-plaintext\">go run main.go\u003C\u002Fcode>\u003C\u002Fpre>\u003Cp>Example:\u003C\u002Fp>\u003Cpre>\u003Ccode class=\"language-plaintext\">package main\r\n\r\nimport (\r\n    \"github.com\u002Fgin-gonic\u002Fgin\"\r\n    \"net\u002Fhttp\"\r\n)\r\n\r\nfunc main() {\r\n    r := gin.Default()\r\n    r.GET(\"\u002F\", func(c *gin.Context) {\r\n        c.String(http.StatusOK, \"Hello, Gin!\")\r\n    })\r\n    r.Run() \u002F\u002F รันเซิร์ฟเวอร์บนพอร์ต 8080\r\n}\r\u003C\u002Fcode>\u003C\u002Fpre>","golang_l2jjfrnzef.webp","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclblg987654321\u002F9t46bpswbqxnhg3\u002Fgolang_l2jjfrnzef.webp","2026-03-04 08:33:55.495Z","",{"keywords":15,"locale":38,"school_blog":48},[16,23,28,33],{"collectionId":17,"collectionName":18,"created":19,"created_by":13,"id":20,"name":21,"updated":22,"updated_by":13},"sclkey987654321","school_keywords","2026-03-04 08:20:33.316Z","ln1ntwattzmxo0o","programming","2026-04-10 16:07:27.299Z",{"collectionId":17,"collectionName":18,"created":24,"created_by":13,"id":25,"name":26,"updated":27,"updated_by":13},"2026-03-04 08:20:11.547Z","ey3puyme01a9bsw","Go","2026-04-10 16:07:25.893Z",{"collectionId":17,"collectionName":18,"created":29,"created_by":13,"id":30,"name":31,"updated":32,"updated_by":13},"2026-03-04 08:33:53.709Z","k5ox6iu2wn2n6co","Go Modules","2026-04-10 16:08:02.738Z",{"collectionId":17,"collectionName":18,"created":34,"created_by":13,"id":35,"name":36,"updated":37,"updated_by":13},"2026-03-04 08:33:54.415Z","dtu0hnobmvg32lx","Dependency Management","2026-04-10 16:08:03.071Z",{"code":39,"collectionId":40,"collectionName":41,"created":42,"flag":43,"id":44,"is_default":45,"label":46,"updated":47},"en","pbc_1989393366","locales","2026-01-22 11:00:02.726Z","twemoji:flag-united-states","qv9c1llfov2d88z",false,"English","2026-04-10 15:42:46.825Z",{"category":49,"collectionId":50,"collectionName":51,"expand":52,"id":66,"views":67},"wqxt7ag2gn7xcmk","pbc_2105096300","school_blogs",{"category":53},{"blogIds":54,"collectionId":55,"collectionName":56,"created":57,"created_by":13,"id":49,"image":58,"image_alt":13,"image_path":59,"label":60,"name":61,"priority":62,"publish_at":63,"scheduled_at":13,"status":64,"updated":65,"updated_by":13},[],"sclcatblg987654321","school_category_blogs","2026-03-04 08:33:53.210Z","59ty92ns80w_15oc1implw.png","https:\u002F\u002Ftwsme-r2.tumwebsme.com\u002Fsclcatblg987654321\u002Fwqxt7ag2gn7xcmk\u002F59ty92ns80w_15oc1implw.png",{"en":61,"th":61},"Golang The Series",1,"2026-03-16 04:39:38.440Z","published","2026-04-25 02:32:15.470Z","xpyoxp3xxzqrzkk",211,"9t46bpswbqxnhg3",[20,25,30,35],"2025-01-27 04:18:02.831Z","Learn how to start a project with Go Modules, install and update external packages, and manage dependency versions professionally.","go-modules-managing-dependency","2026-04-25 02:47:28.502Z",{"en":72}]