HomeCoursesWrite Professional Command-line Programs in Go
AI-powered learning
Save

Write Professional Command-line Programs in Go

Gain insights into writing professional command-line programs in Go. Delve into structuring Go programs, writing idiomatic code, testing effectively, and impressing users and managers.

4.7
63 Lessons
28h 30min
Updated yesterday
Join 2.9 million developers at
Join 2.9 million developers at
LEARNING OBJECTIVES
  • Identify CLI inputs/outputs: commands, flags, args, streams, piping, and exit codes
  • Refactor a Go CLI into modular packages and a cmd/ structure using Go modules
  • Write and run unit tests with Go testing, including table-driven and parallel tests
  • Create BDD unit and end-to-end tests with Ginkgo/Gomega and generate coverage profiles
  • Build structured CLIs with Cobra using root commands, subcommands, and persistent/local flags
  • Implement configuration with Viper across flags, env vars, files, and remote sources with precedence
  • Automate builds and releases using go build flags, GitHub Actions, Docker, and Makefiles

Learning Roadmap

63 Lessons24 Quizzes

2.

Restructuring multi-git

Restructuring multi-git

Unpack the core of restructuring multi-git for better code organization and collaboration.

3.

Testing 1,2,3...

Testing 1,2,3...

11 Lessons

11 Lessons

Examine Go's testing capabilities, tools like Ginkgo and Gomega, and comprehensive e2e testing.

4.

Adding Smart Command-Line Parsing

Adding Smart Command-Line Parsing

13 Lessons

13 Lessons

Grasp the fundamentals of using Cobra for structured command-line applications in Go.

5.

Adding Advanced Configuration

Adding Advanced Configuration

13 Lessons

13 Lessons

Harness advanced configuration techniques in Go, using Viper and Cobra for flexible and efficient command-line programs.

6.

Adding Bells and Whistles

Adding Bells and Whistles

13 Lessons

13 Lessons

See how it works to enhance Go command-line programs with builds, linking, CI/CD, and Docker.
Certificate of Completion
Showcase your accomplishment by sharing your certificate of completion.
Author NameWrite Professional Command-line Programsin Go

Show License and Attributions

Developed by MAANG Engineers
ABOUT THIS COURSE
In this course you will learn why Go is an awesome language for writing command-line programs. You will learn how to structure your Go programs, how to write idiomatic Go code, how to test your programs and how to amaze your users, peers and managers. The focus is on command-line programs in order to keep the course down to earth, but most of the principles and best practices you will learn apply to any Go program.
ABOUT THE AUTHOR

Gigi Sayfan

I'm the DevOps team manager at Helix - a bioinformatics and genomics start-up, author of several books on Kubernetes and Go as well as hundreds of technical articles. I program professionally for 20+ years and still amazed when anything actually works.

Learn more about Gigi

Trusted by 2.9 million developers working at companies

These are high-quality courses. Trust me the price is worth it for the content quality. Educative came at the right time in my career. I'm understanding topics better than with any book or online video tutorial I've done. Truly made for developers. Thanks

A

Anthony Walker

@_webarchitect_

Just finished my first full #ML course: Machine learning for Software Engineers from Educative, Inc. ... Highly recommend!

E

Evan Dunbar

ML Engineer

You guys are the gold standard of crash-courses... Narrow enough that it doesn't need years of study or a full blown book to get the gist, but broad enough that an afternoon of Googling doesn't cut it.

S

Software Developer

Carlos Matias La Borde

I spend my days and nights on Educative. It is indispensable. It is such a unique and reader-friendly site

S

Souvik Kundu

Front-end Developer

Your courses are simply awesome, the depth they go into and the breadth of coverage is so good that I don't have to refer to 10 different websites looking for interview topics and content.

V

Vinay Krishnaiah

Software Developer

Built for 10x Developers

No Passive Learning
Learn by building with project-based lessons and in-browser code editor
Learn by Doing
Personalized Roadmaps
The platform adapts to your strengths & skills gaps as you go
Learn by Doing
Future-proof Your Career
Get hands-on with in-demand skills
Learn by Doing
AI Code Mentor
Write better code with AI feedback, smart debugging, and "Ask AI"
Learn by Doing
Learn by Doing
MAANG+ Interview Prep
AI Mock Interviews simulate every technical loop at top companies
Learn by Doing

Free Resources

FOR TEAMS

Interested in this course for your business or team?

Unlock this course (and 1,000+ more) for your entire org with DevPath