Created
July 16, 2012 20:39
-
-
Save larzconwell/3124903 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" | |
"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