Named result parameters / values in Go

In this example
func WebCmd(cmd string) (restCall string) {
m := map[string]string{
"c":   "",
"t":   "",
"lox": "",
restCall = m[cmd]
restCall is the named return parameter of type string and cmd is the unnamed parameter required to call theWebCmd function. Within the WebCmd function the string value of m[cmd] is assigned to the restCall variable which is returned by the WebCmd function.


Popular posts from this blog

Tuning ext4 for performance with emphasis on SSD usage

Rust’s impact on the industry

Brandan Eich on WebAssembly, Web Workers, and Decorators