Building a module in Go (Golang) (Udemy.com)
Learn to build a reusable, well-tested module in Go
Created by: Trevor Sawler
Last updated June 2024
What you will learn
- How to build a platform agnostic, re-usable Go module
- How to share your module with other Go developers
- How to write tests for your module
- How to manage multiple versions of your module
- How to use Go 1.18's new go work feature, workspaces
Quality Score
No CourseDuck member has rated this course yet. Taken it? Give each part a thumbs up or down.
Overall Score : 92 / 100
Course Description
Working with web applications in Go is remarkably easy, but it does not take too long to realize that in a lot of cases, we end up writing the same kind of code every time we start a new project. You might need to read JSON, write JSON, upload files, or any of the commonly used features of a given web application. In other words, we often rewrite code that we have already written, many times over.
Rather than simply copying and pasting code from one project to another, it makes sense to take advantage of Go modules -- reusable code that can be included in a project by simply issuing a "go get" command. That way, if new functionality is added to that module, any project that imports it can take advantage of that functionality simply by updating its dependencies, and if a bug is discovered, you can fix it by updating the module; every project that uses that module gets the bug fix with a single "go get -u" command.
Building a robust, secure, well-tested module is not difficult, but it does require careful planning to ensure that it will work across different operating systems.
This course will take you through the steps necessary to produce a module that includes many of the tasks commonly used in web applications, including:
reading JSON
writing JSON
producing well formatted, informative error messages
uploading one or more files to a server, and limiting uploads by mime type and file size
creating directories on the server
generating random strings
downloading static files
posting JSON to a remote service
creating a URL safe slug from a string
We'll build our module using Go 1.18's new workspaces tools, and we'll ensure that the entire module is well-tested.
Our final module will not have any external dependencies, and will only use functionality found in Go's standard library.
By the time you have finished this course, you'll have a Go module that will make starting a new web application much faster, and you won't be depending on someone else's code to do so.
Instructor Details
- 4.6 Rating
454 Reviews
Trevor Sawler
I have twenty years of experience in professional software development, and twenty years of experience as a University professor.
As an entrepreneur, I have worked with a broad range of clients, including Thomson Nelson, Hewlett Packard, the Royal Bank of Canada, Keybank, Sprint, and many, many others. I also have extensive management and project management experience. I have led teams of fifty developers and artists on multi-million dollar projects, and much smaller teams on much smaller projects.
As a professor, I have taught in a wide variety of course areas, including Computer Science, English, Irish, and American literature, and a number of "crossover" courses that bridge the liberal arts and technological fields.
I have won regional, national, and international awards for my work in the IT field, and have also won awards for my teaching and research as a University professor.
More courses by Trevor Sawler
Building Modern Web Applications with Go (Golang) (2022)
4.6 (5,848 Reviews)
Provider: Udemy
Time: 29.6h
$84.99
Working with Microservices in Go (Golang) (2024)
4.6 (3,186 Reviews)
Provider: Udemy
Time: 11.6h
$89.99
Working with Concurrency in Go (Golang) (2024)
4.7 (1,862 Reviews)
Provider: Udemy
Time: 9.7h
$79.99
Building Web Applications with Go - Intermediate Level (2025)
4.8 (597 Reviews)
Provider: Udemy
Time: 18.7h
$84.99
More Go courses
Succinct Go Structs, Maps, Interfaces & Exercises (BOOK 3) (2025)
4.9 (31 Reviews)
Provider: Udemy
Time: 4h
$54.99
gRPC [Golang] Master Class: Build Modern API & Microservices (2023)
4.7 (5,106 Reviews)
Provider: Udemy
Time: 3.8h
$99.99
Go Bootcamp: Master Golang with 1000+ Exercises and Projects (2021)
4.7 (4,012 Reviews)
Provider: Udemy
Time: 15.8h
$99.99
Working with Concurrency in Go (Golang) (2024)
4.7 (1,862 Reviews)
Provider: Udemy
Time: 9.7h
$79.99
Go: The Complete Modern Golang Developer's Guide (2024)
4.7 (32 Reviews)
Provider: Udemy
Time: 10.8h
$64.99
Reviews
By Brett Roscoe on 7/19/2026
I have taken a number of courses from this instructor, and this is one of the shorter ones, but I have to say I have had a lot of fun working through it. Students are walked through the process of building, testing, and publishing, and versioning a Go package that contains a number of utility methods for web development.
By Brad Wilson on 1/11/2026
I have taken several of Trevor Sawler’s Go courses, and this one stands out as especially practical. Trevor’s teaching style focuses on quickly demonstrating real working code and then applying it in ways you will actually use in real projects. What made this course different for me is that it forced me to follow along rather than just watch. Repeating the steps for building modules, updating versions, and working with Go workspaces builds real muscle memory. After a short time, concepts like project organization and reuse stopped feeling confusing and started to feel natural. If I had finished this course when I first bought it, it would have saved me a lot of time and frustration. Many delays in past projects came from not fully understanding how to structure reusable Go code. This course would have eliminated much of that. If you are serious about Go and want to stop rewriting the same code across projects, this course is absolutely worth taking.
By Timothy Boudreau on 11/19/2025
A good introduction to creating Go modules with simple examples that includes guidance on publishing repository versioning. By the end of the course I had successfully created my own Go module, published it, and imported it into a new project. -- Thanks Dr. Sawler, your courses are always a pleasure and, though some may not, I appreciate the dedicated time you give to writing testing and consistently updating them. Too often in my teams I see this being overlooked as an afterthought or as a separate task, but the way you incorporate that flow into every feature for your courses is how we should all operate as professional programmers.
By Adam Gralinski on 7/12/2024
Overall OK, but I feel there were too many errors made by the lecturer. It's OK to have a typo and correct it "live", but I think that bigger mistakes - as e.g. malformed json spec that makes the app not compile - are too much, and should have been edited out. As it is, the course feels hastily made, without much attention to detail. The other courses by T. Sawler I've attended so far were top notch.
By Javier Vallejo on 8/26/2023
It was a very nice course. I have some suggestions: the second example was a bit long (or complex for me), maybe it should be at the end. In my case, some projects were not easy to understand the objective, it would be nice if at the beginning of each lecture we can got a view or a simple diagram of the functionality. Thanks.
By Ubeydullah Keles on 8/23/2023
Content, instructor's knowledge, pace, all are great. I'd recommend the course to all of you out there if that's the kind of content that you are looking for. As for me, it was a bit more advanced than I first thought. I am very new to Go and new to web development, and so it wasn't really possible to follow and understand all of it. But, that is about my level. Thanks for the course!
By Peter Barrett on 4/9/2023
Another very useful course within the Golang programming series from Trevor Sawler. Once again I found this course very practical, not only from the point of view of handling JSON but other practical aspects such as using workspaces within VS Code and the principle of semantic versioning. The result is a useful module for future projects. A very practical course from an equally practical teacher... highly recommended.
By Richard Orman on 4/2/2023
The course starts strong by getting you started with organizing your project in sections 2-3. Then it all pulls together in section 9. The prior sections are there to help reinforce the importance and how to write good tests, but a good listen. I will definitely implement this pattern of creating modules in my future work as it keeps everything clean and separated into individual projects, making things manageable when the code base starts getting large and you work with multiple teams. This course is an excellent addition if you want to learn how to organize your GoLang work for others and your future self to consume.
By Anonymized User on 3/5/2023
The content of the course is nice and the result of having a simple toolkit is good. But it is hard for non-native listeners to follow the videos and writing the code while listen. There should be some more breaks for writing them. Otherwise it will leads to, that all code will be downloaded instead of writing it. And imho it is better if trhe code will be written by very one as self to understand them.
By Juergen Holtz on 3/5/2023
I wished there was more background on Go modules, for instance, before Go workspaces have been introduced and afterwards, a bit more about the best practice to structure a project and the use of go commands to deal with modules and packages. There is more focus to create small utilities that are then delivered as part of that module. This is nice for doing some initial steps with Go as you code along with the instructor, but conceptual background is missing. I would find it better, if the instructor left coding the utilities as a challenge for the students, of course giving hints how to solve this in order not to get lost. It is good that the functions added to the module are also covered in a module test. Here again, I'd expect a brief intro to not just code along w/o knowing the details. It is a pity that the instructor doesn't write the tests first before he codes the actual function, as this would teach students the TDD-approach. Overall, the course delivers what I'd expect but I wished more theoretical background was provided.








![gRPC [Golang] Master Class: Build Modern API & Microservices](/programming/go/images/1792960_19b1_11.jpg?v=1789268175)


