im converting some code from python to go
here i want write equal code in go lang:
python :
while g_day_no >= g_days_in_month[i] + (i == 1 and leap):
g_day_no -= g_days_in_month[i] + (i == 1 and leap)
i+=1
my try:
leap := int32(1)
var i = int32(0)
for g_day_no >= (g_days_in_month[i] + (i == 1 && leap)){
g_day_no -= g_days_in_month[i] + (i == 1 && leap)
i+=1
}
but i have error in ide that say :
Invalid operation: i == 1 && leap (mismatched types bool and int32)
for this section (i == 1 && leap)
how can i correct this part of my code?