All languages

Go for DevOps

You're viewing a free preview. Sign in free to read every script.

Why this exists Two features let Go code stay flexible without inheritance: interfaces (describe what a value can do ) and generics (write one function for many types). Every DevOps tool uses interfaces constantly…

Go for DevOps: Interfaces, Type Switches, io.Writer and Generics with Constraints

Write code that works with behaviour instead of concrete types: implicit interfaces, accept interfaces and return structs, io.Writer for testable output, type switches, and generics (constraints, Map and Filter, a generic Stack, comparable) with the real compiler errors for a missing method and an unsatisfied constraint.

Sign in free to read this script, along with the rest of the library.

Sign in free