The Many Faces of Struct Tags
Offered By: Gopher Academy via YouTube
Course Description
Overview
Explore the versatile applications of struct tags in Go through this 22-minute conference talk from GopherCon 2015. Delve into practical and unconventional uses of this underutilized feature, including object-relational mapping, validation functions, middleware definition, and command-line options. Learn about namespacing, serialization, tag safety, and the potential for code generation with struct tags. Gain insights into clever implementations like the MustHave tag and unusual mapping cases, as well as their role in handling default values and type validation. Discover how struct tags can enhance your Go programming beyond common JSON and XML field specifications.
Syllabus
Intro
Why are we here?
What we've built
What is a struct tag?
Why?
Namespacing
Serialization
Tag Safety
MustHave Tag
A More Unusual Mapping Case
Command-line Configuration
Default Values
How About Type Validation?
Foreign Languages
The Future: Code Generation?
Taught by
Gopher Academy
Related Courses
A Holistic Go ExperienceGopher Academy via YouTube Safe, Fast, and Easy - Building a Plugin System with WebAssembly
Gopher Academy via YouTube A Journey Through Integration Testing with Go - What Could Go Wrong?
Gopher Academy via YouTube Kraken Wrangling for Dummies - Go Module Dependency Management at Scale
Gopher Academy via YouTube Go, the Data Engineer's Missing Tool?
Gopher Academy via YouTube