Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Example Functions #54

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gongqi-zhen
Copy link

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
%

makoto@miyazakimakotonoMacBook-Pro methods % 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
makoto@miyazakimakotonoMacBook-Pro methods % go test -v
=== RUN   ExamplePrintDuration
--- PASS: ExamplePrintDuration (0.00s)
=== RUN   ExamplePrintReplacer
--- PASS: ExamplePrintReplacer (0.00s)
PASS
ok  	gopl.io/ch12/methods	0.123s
makoto@miyazakimakotonoMacBook-Pro methods %
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant