Skip to content

Instantly share code, notes, and snippets.

@teivah
Created August 22, 2019 18:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teivah/c9caccbe8f2983313f4e8c8f4032bc62 to your computer and use it in GitHub Desktop.
Save teivah/c9caccbe8f2983313f4e8c8f4032bc62 to your computer and use it in GitHub Desktop.
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