Skip to Content
Learning Functional Programming in Go
book

Learning Functional Programming in Go

by Lex Sheehan
November 2017
Intermediate to advanced
670 pages
17h 35m
English
Packt Publishing
Content preview from Learning Functional Programming in Go

Interface-driven development

Recall the following quote from Chapter 4SOLID Design in Go?

"It makes sense to categorize a thing by its abilities, because everything is defined by its actions."

Since this is a book about functional programming, now would be a good time to mention that a major benefit of using interfaces is that they allow us to group our application's functions in order to model real-life behaviors.  

In the previous chapter, we modeled the behavior of a duck:

type StrokeBehavior interface {       PaddleFoot(strokeSupply *int)}type EatBehavior interface {       EatBug(strokeSupply *int)}

In this chapter, we will look at manipulating files in the Google Cloud Platform (GCP). Our interface defines the four behaviors of interest:

type ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Functional Programming

Learning Functional Programming

Jack Widman

Publisher Resources

ISBN: 9781787281394Supplemental Content