Home >Backend Development >Golang >Can Go Statements Span Multiple Lines Like Python?
In Python, backslashes () can be used to continue a statement onto the next line.
Would it be possible to do the same in Go?
Yes, it is possible to write multi-line statements in Go by placing an operator at the end of the line.
Note that it is not possible to break the line before the operator. The following code is invalid:**
This behavior is explained in the official Go language specification.
The above is the detailed content of Can Go Statements Span Multiple Lines Like Python?. For more information, please follow other related articles on the PHP Chinese website!