![]() ![]() If we have used break of other languages then it is very much similar to those breaks. ![]() To explain the working of the continue statement in go language we have taken the diagram below. } How Does Continuation Statement Work in Go language? Mostly we use the continue statement to skip the execution of some specific conditions or simply move to the next iteration of the loop.Ĭontinue //Here we have used the continue statement inside the loop ![]() Generally, we put this continue on any condition where we want to skip the execution and go to the next iteration of the execution of the program. Syntaxīelow is a simple syntax for the continue statement, here we have written continue inside the loop, this loop can be for a loop. In go language continue statement allow the developer to skip the particular condition and start from the next value, for example, if we have a list of students and we want to add some extra marks to each student except for the students belongs to a particular section, in that case, we can put continue statement in the loop and the execution will start from the next section, we can say continue is little similar to break of other programing language and it allows us to skip the iteration of the loop at any time inside the loop, with the help of the continue statement we are able to avoid unnecessary execution of some codes. ![]() Introduction to Golang Continue Statement ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |