Last active
December 16, 2019 11:06
-
-
Save jjuliano/13a0373fd2811cc72e731bad3e1d62e3 to your computer and use it in GitHub Desktop.
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
package main | |
import "fmt" | |
func main() { | |
basket(map[string]string{ | |
"name": "apple", | |
"flavour": "It's a little sour and bitter, but mostly sweet, not at all salty, very juicy in general.", | |
}, "fruit") | |
} | |
func basket(args ...interface{}) { | |
item := args[0].(map[string]string) | |
kind := args[1] | |
fmt.Printf("Name: %s\nFlavour: %s\nKind: %s\n", item["name"], item["flavour"], kind) | |
} | |
// Name: apple | |
// Flavour: It's a little sour and bitter, but mostly sweet, not at all salty, very juicy in general. | |
// Kind: fruit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment