Skip to content

Instantly share code, notes, and snippets.

@teivah
Created August 22, 2019 17:57
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/bb4fa467006998a8725f05f916ae88d6 to your computer and use it in GitHub Desktop.
Save teivah/bb4fa467006998a8725f05f916ae88d6 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"time"
)
func main() {
t := duration(time.Now(), time.Second)
fmt.Printf("%v\n", t)
}
func duration(now time.Time, 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