Created
February 7, 2018 13:25
-
-
Save tomtsang/a0035f473c9e40ee4cfddaaf83609a8f to your computer and use it in GitHub Desktop.
golang-func-6.3
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
//6.3 传递变长参数 | |
func typecheck(..,..,values … interface{}) { | |
for _, value := range values { | |
switch v := value.(type) { | |
case int: … | |
case float: … | |
case string: … | |
case bool: … | |
default: … | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment