Function and Return Types by Example in Go (golang)
Functions are central in Go. We’ll learn about functions with a few different examples.
Example:
package main
import "fmt"
//Function and Return Types by Example in Go (golang)
func main() {
mycard := newInt()
fmt.Println(mycard)
}
func newCard() string {
return "This is New Card"
}
func newInt() int {
return 123
}