Created
August 22, 2019 18:03
-
-
Save teivah/c9caccbe8f2983313f4e8c8f4032bc62 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
var now = time.Now | |
func main() { | |
t := duration(time.Second) | |
fmt.Printf("%v\n", t) | |
} | |
func duration(d time.Duration) time.Time { | |
return now().Add(d) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment