Reflection you need to use, whether it be with interface{} in Go or with $scalar in Perl is runtime thing. reflect.TypeOf(tst), ref($tst) - there's no much difference.
Type mismatch errors for basic types are handled in compile time, be it Go or Perl.
Type mismatch errors for basic types are handled in compile time, be it Go or Perl.