Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Latest commit

 

History

History

callback

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Callbacks

Go treats functions as first class objects: they can be passed from function to function and then called.

In this example we demonstrate how this happens: the GetEnv function is passed to the PrintFOO method as a variable.

This allows for injecting a custom GetEnv for testing purposes.

See the code »