PHONG B NGUYEN

7%
Flag icon
Notice how the call to ParseForm is nested within an if statement. Go allows a simple statement such as a local variable declaration to precede the if condition, which is particularly useful for error handling as in this example. We could have written it as err := r.ParseForm() if err != nil {     log.Print(err) } but combining the statements is shorter and reduces the scope of the variable err, which is good practice.
The Go Programming Language
Rate this book
Clear rating
Open Preview