- Unused variables in
blocked scopeare not allowed in Go since they causemaintenance nightmares. If we declare a variable inblocked scopethen we must use it or else completely remove it from the block. We cannot have unused variables declared inblocked scopedangling in our source codes. Go throws unused variable errors atcompile timeonly. - We should avoid using
package levelvariables. Go doesn’t throwunused variable errorsatcompile timefor variables declared atpackage level.