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

The solution 

The solution we're looking for would allow a new constructor to accept a variable number of parameters with the following characteristics:

  • Predefining default values (where no parameter is passed for that particular setting)
  • Only passing values that have meaning 
  • Harnessing the power of the Go programming language to customize the value of the parameter passed

Much of this design comes from one of Rob Pike's blog posts.

Refer to self-referential functions and the design of options, by Rob Pike in his blog post at https://commandcenter.blogspot.com/2014/01/self-referential-functions-and-design.html.

Kudos for sharing the closure technique of returning a function literal in which we set the value of our server setting. We'll ...

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