Fixed the sample code for naked return (#29001)

Wrong function name and wrong variable name
This commit is contained in:
Shashank Goyal
2019-01-20 00:27:09 +00:00
committed by Tom
parent 57e64df74b
commit 03d8721155

View File

@ -75,12 +75,12 @@ You can name the return types so that you don't need to pass variable to the ret
```go
func duplicate(s string) (first, second string) {
first = s
last = s
second = s
return
}
func main() {
fmt.Println(split("Hello world!")) // ("Hello world!", "Hello world!")
fmt.Println(duplicate("Hello world!")) // ("Hello world!", "Hello world!")
}
```