Skip to content

Instantly share code, notes, and snippets.

@brianium
Created December 18, 2014 19:09
Show Gist options
  • Save brianium/85a98e30e1861a2e1432 to your computer and use it in GitHub Desktop.
Save brianium/85a98e30e1861a2e1432 to your computer and use it in GitHub Desktop.
interval.go
import "time"
type Interval struct {
Start Time
End Time
}
func NewInterval(start string, end string) Interval {
startTime, err := time.Parse(time.RFC3339, start)
if err != nil {
panic(err.Error())
}
endTime, err := time.Parse(time.RFC3339, end)
if err != nil {
panic(err.Error())
}
return Interval{Start:startTime, End:endTime}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment