It is possible to use multiple expression in go loop like:
for _, err := range errs; err != nil {
}
Or I have to do like:
for _, err := range errs {
if err != nil {
statement
}
}
It is possible to use multiple expression in go loop like:
for _, err := range errs; err != nil {
}
Or I have to do like:
for _, err := range errs {
if err != nil {
statement
}
}
收起
Per the documentation:
ForStmt = "for" [ Condition | ForClause | RangeClause ] Block .
Condition = Expression .
You can either have a Condition, or a ForClause, or a RangeClause. You cannot combine them.
报告相同问题?