gopl.io
gopl.io copied to clipboard
Fix Example Functions
Please take it in.
Thank you.
% go doc time.Duration
package time // import "time"
type Duration int64
A Duration represents the elapsed time between two instants as an int64
nanosecond count. The representation limits the largest representable
duration to approximately 290 years.
func ParseDuration(s string) (Duration, error)
func Since(t Time) Duration
func Until(t Time) Duration
func (d Duration) Hours() float64
func (d Duration) Microseconds() int64
func (d Duration) Milliseconds() int64
func (d Duration) Minutes() float64
func (d Duration) Nanoseconds() int64
func (d Duration) Round(m Duration) Duration
func (d Duration) Seconds() float64
func (d Duration) String() string
func (d Duration) Truncate(m Duration) Duration
%
% go test -v
=== RUN ExamplePrintDuration
--- PASS: ExamplePrintDuration (0.00s)
=== RUN ExamplePrintReplacer
--- PASS: ExamplePrintReplacer (0.00s)
PASS
ok gopl.io/ch12/methods 0.123s
%