Practical Advice for Go Library Authors
Offered By: Gopher Academy via YouTube
Course Description
Overview
Explore practical advice for Go library authors in this 41-minute conference talk from GopherCon 2016. Dive into essential topics such as naming conventions, object construction, zero value considerations, and constructor functions. Learn about singleton options, effective logging practices, and the pros and cons of interfaces versus structs. Discover best practices for creating random packages, handling panics, and working with channels and goroutines. Gain insights on when to use context.Context, designing for efficiency, and leveraging /vendor in libraries. Master the art of clean code organization and effective use of build tags to create robust and user-friendly Go libraries.
Syllabus
Intro
Naming examples
Object construction
Zero value considerations
Working with zero values
New constructor function
What do these do?
Singleton options
Logging counter-example
Logging advice
Better logging example
interfaces vs structs
Let's make a random package
When to panic
Channels
When to spawn goroutines
When to use context.Context and when not to
If something is hard to do, make someone else do it
Designing for efficiency
Using /vendor in libraries
Build tags
Staying clean
Taught by
Gopher Academy
Related Courses
Concurrency in GoUniversity of California, Irvine via Coursera Go Essential Training
LinkedIn Learning Concurrency in Go (Golang)
Udemy Go Language Overview Course (How To)
Treehouse Concurrent Programming with Go
Pluralsight