Skip to content

Instantly share code, notes, and snippets.

@larzconwell
Created July 16, 2012 20:39
Show Gist options
  • Save larzconwell/3124903 to your computer and use it in GitHub Desktop.
Save larzconwell/3124903 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"time"
"errors"
)
func run() (str string, err error) {
time := time.Now()
str = ""
err = nil
if time.Minute() < 30 {
err = errors.New("Error[TimeError]: You're under 30 minutes!")
} else {
str = "Past 30 minutes!"
}
return
}
func main() {
str, err := run()
if err != nil {
fmt.Println(err)
} else {
fmt.Println(str)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment