Skip to content

Commit

Permalink
Update go-quiz.md (Ebazhanov#2866)
Browse files Browse the repository at this point in the history
Q23: Time.Add() accepts a Duration parameter and returns a Time while Time.Sub() accepts a Time parameter and returns a Duration.
  • Loading branch information
DiscreteLogarithm authored Dec 28, 2021
1 parent 83402bc commit 902f4fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions go/go-quiz.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ Relevant excerpt from the article:

- [ ] Time.Add() is for performing addition while Time.Sub() is for nesting timestamps.
- [ ] Time.Add() always returns a later time while time.Sub always returns an earlier time.
- [x] They are opposites. Time.Add(x) is the equivalent of Time.Sub(-x).
- [ ] Time.Add() accepts a Duration parameter and returns a Time while Time.Sub() accepts a Time parameter and returns a Duration.
- [ ] They are opposites. Time.Add(x) is the equivalent of Time.Sub(-x).
- [x] Time.Add() accepts a Duration parameter and returns a Time while Time.Sub() accepts a Time parameter and returns a Duration.

Reference: [time#Time.Add](https://pkg.go.dev/time#Time.Add)

Expand Down

0 comments on commit 902f4fc

Please sign in to comment.