nolint:cyclop,funlen
(r util.Reader)
| 886 | |
| 887 | //nolint:cyclop,funlen |
| 888 | func readHeader(r util.Reader) (*header, error) { |
| 889 | h := new(header) |
| 890 | |
| 891 | id, err := r.ReadByte() |
| 892 | if err != nil { |
| 893 | return nil, fmt.Errorf("readHeader: ReadByte error: %w", err) |
| 894 | } |
| 895 | |
| 896 | if id == idArchiveProperties { |
| 897 | /* |
| 898 | id, err = r.ReadByte() |
| 899 | if err != nil { |
| 900 | return nil, fmt.Errorf("readHeader: ReadByte error: %w", err) |
| 901 | } |
| 902 | */ |
| 903 | return nil, errors.New("sevenzip: TODO idArchiveProperties") //nolint:err113 |
| 904 | } |
| 905 | |
| 906 | if id == idAdditionalStreamsInfo { |
| 907 | /* |
| 908 | id, err = r.ReadByte() |
| 909 | if err != nil { |
| 910 | return nil, fmt.Errorf("readHeader: ReadByte error: %w", err) |
| 911 | } |
| 912 | */ |
| 913 | return nil, errors.New("sevenzip: TODO idAdditionalStreamsInfo") //nolint:err113 |
| 914 | } |
| 915 | |
| 916 | if id == idMainStreamsInfo { |
| 917 | if h.streamsInfo, err = readStreamsInfo(r); err != nil { |
| 918 | return nil, err |
| 919 | } |
| 920 | |
| 921 | id, err = r.ReadByte() |
| 922 | if err != nil { |
| 923 | return nil, fmt.Errorf("readHeader: ReadByte error: %w", err) |
| 924 | } |
| 925 | } |
| 926 | |
| 927 | if id == idFilesInfo { |
| 928 | if h.filesInfo, err = readFilesInfo(r); err != nil { |
| 929 | return nil, err |
| 930 | } |
| 931 | |
| 932 | id, err = r.ReadByte() |
| 933 | if err != nil { |
| 934 | return nil, fmt.Errorf("readHeader: ReadByte error: %w", err) |
| 935 | } |
| 936 | } |
| 937 | |
| 938 | if id != idEnd { |
| 939 | return nil, errUnexpectedID |
| 940 | } |
| 941 | |
| 942 | if h.streamsInfo == nil || h.filesInfo == nil { |
| 943 | return h, nil |
| 944 | } |
| 945 |
no test coverage detected
searching dependent graphs…