Commits

Fazlul Shahriar  committed c8e3e7b

clean up

  • Participants
  • Parent commits 8572994

Comments (0)

Files changed (1)

File hdf4/hdf4.go

 		return nil, err
 	}
 	if bytes.Compare(magic, hdfMagic) != 0 {
-		return nil, errors.New("not a HDF file")
+		return nil, errors.New("hd4: not a HDF file")
 	}
 	if err = file.readDescriptors(); err != nil {
 		return nil, err
 func (file *File) LookupRecord(tag, ref int) (*Record, error) {
 	var rec *Record
 	for i := 0; i < len(file.Records); i++ {
-		rec = &file.Records[i]
-		if ref < 0 && int(rec.Tag) == tag {
-			goto found
+		r := &file.Records[i]
+		if ref < 0 && int(r.Tag) == tag {
+			rec = r
+			break
 		}
-		if int(rec.Ref) == ref && int(rec.Tag) == tag {
-			goto found
+		if int(r.Ref) == ref && int(r.Tag) == tag {
+			rec = r
+			break
 		}
 	}
-	return nil, errors.New("tag/ref not found")
-
-found:
+	if rec == nil {
+		return nil, errors.New("hdf4: tag/ref not found")
+	}
 	if rec.Info == nil && !rec.parsing {
 		b, err := rec.readPayload()
 		if err != nil {