Early error check in golang struct reading

avoids a timeout on malformed input found by fuzzing
1 file changed