Last active
June 5, 2020 12:08
-
-
Save eminetto/5c191aae65db8f74e94b6da97eda211c to your computer and use it in GitHub Desktop.
can.go
This file contains hidden or 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
//this way? | |
func CanSubscribe(userID int, courseID int) bool { | |
} | |
//this way? | |
func CanSubscribe(userID int, courseID int) error { | |
//if can't subscribe return an error | |
//if can return nil | |
//if there's an error, like a database connection error, return the error itself | |
} | |
//or this way? | |
func CanSubscribe(userID int, courseID int) (bool, error) { | |
//if can't subscribe return an false and an error | |
//if can return true and nil | |
//if there's an error return false and an error | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment