golang function can have multiple return values. Can you specify the number of return values for chained calls, such as the following code:
package main
import "fmt"
func test()(s string,err error){
return "hello",nil
}
func main(){
fmt.Println("HelloWorld ",test().s)
}
I hope that after the test () function, ignore err and directly use the first argument, how can it not be called without defining a new variable?
both test () and test (). S are the same error:
. / tempCodeRunnerFile.go:8: multiple-value test () in single-value context
can"t multiple return values be called in chains?