Advertisement
cwchen

[Go] Functions with parameters.

Sep 30th, 2017
832
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.18 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5. )
  6.  
  7. func hello(name string) {
  8.     fmt.Println(fmt.Sprintf("Hello %s", name))
  9. }
  10.  
  11. func main() {
  12.     hello("Michael")
  13.     hello("Jenny")
  14.     hello("Tommy")
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement