ex7.07

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

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

Go to latest
Published: Jun 28, 2018 License: MIT Imports: 4 Imported by: 0

README

Exercise 7.7 (P181)

Explain why the help message contains °C when the default value of 20.0 does not.

Answer: The flag's value is a Stringer, and is used in command-line help messages. Celsius has a func (c Celsius) String() string method, so Celsius is a Stringer. When flag shows the help messages, it will call Celsius' String method to format the value.

Documentation

Overview

Tempflag prints the value of its -temp (temperature) flag.

Jump to

Keyboard shortcuts

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