lesson14

command
v0.0.0-...-8eea285 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Experiment: calibrate.go Type listing 14.6 into the Go Playground to see it in action: * Rather than passing 5 as an argument to calibrate, declare and pass a variable. Modify the variable and you’ll notice that calls to sensor() still result in 5. That’s because the offset parameter is a copy of the argument (pass by value). * Use calibrate with the fakeSensor function from listing 14.2 to create a new sensor function. Call the new sensor function multiple times and notice that the original fakeSensor is still being called each time, resulting in random values.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL