use for loop than using goto statement

Signed-off-by: Deepak Kumar <deepakkumarnd@gmail.com>
Yeah, cause `var name string` gives the zero value for `string` -- the empty string.