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

More reasons to design using interfaces

As if that's not enough reason to design using interfaces.

We also get access to a plethora of functionality. For example, when working with readers and writers, we get the following for free:

Free functionality Description

io.Copy

// Copy copies from src to dst until either EOF is reached// on src or an error occurs. It returns the number of bytes// copied and the first error encountered while copying, if any.func Copy(dst Writer, src Reader) (written int64, err error) {       return copyBuffer(dst, src, nil)}

io.LimitReader

// A LimitedReader reads from R but limits the amount of// data returned to just N bytes. Each call to Read// updates N to reflect the new amount remaining.// Read returns ...
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