I\'m just started learning go lang, and I am confused about declaring variables in go lang
for example I\'ve declare req, er inside if...el
req
er
This is because you have declared the variables req and er inside the if else condition and are trying to use it outside the scope (the scope is just the if and else inside which they are declared).
if else
if
else
You need to declare er and req outside the if else