func mergePAX(hdr *Header, headers map[string]string) error {
	for k, v := range headers {
		switch k {
		case paxPath:
			hdr.Name = v
		case paxLinkpath:
			hdr.Linkname = v
		case paxGname:
			hdr.Gname = v
		case paxUname:
			hdr.Uname = v
		case paxUid:
			uid, err := strconv.ParseInt(v, 10, 0)
			if err != nil {
				return err
			}
			hdr.Uid = int(uid)
		case paxGid:
			gid, err := strconv.ParseInt(v, 10, 0)
			if err != nil {
				return err
			}
			hdr.Gid = int(gid)
		case paxAtime:
			t, err := parsePAXTime(v)
			if err != nil {
				return err
			}
			hdr.AccessTime = t
		case paxMtime:
			t, err := parsePAXTime(v)
			if err != nil {
				return err
			}
			hdr.ModTime = t
		case paxCtime:
			t, err := parsePAXTime(v)
			if err != nil {
				return err
			}
			hdr.ChangeTime = t
		case paxSize:
			size, err := strconv.ParseInt(v, 10, 0)
			if err != nil {
				return err
			}
			hdr.Size = int64(size)
		default:
			if strings.HasPrefix(k, paxXattr) {
				if hdr.Xattrs == nil {
					hdr.Xattrs = make(map[string]string)
				}
				hdr.Xattrs[k[len(paxXattr):]] = v
			}
		}
	}
	return nil
}
// mergePAX merges well known headers according to PAX standard.
// In general headers with the same name as those found
// in the header struct overwrite those found in the header
// struct with higher precision or longer values. Esp. useful
// for name and linkname fields.
mergePAX merges well known headers according to PAX standard.
In general headers with the same name as those found
in the header struct overwrite those found in the header
struct with higher precision or longer values. Esp. useful
for name and linkname fields.
// mergePAX merges well known headers according to PAX standard . // In general headers with the same name as those found // in the header struct overwrite those found in the header // struct with higher precision or longer values . Esp . useful // for name and linkname fields .
func mergePAX(hdr *Header, headers map[string]string) error {
	for k, v := range headers {
		switch k {
		case paxPath:
			hdr.Name = v
		case paxLinkpath:
			hdr.Linkname = v
		case paxGname:
			hdr.Gname = v
		case paxUname:
			hdr.Uname = v
		case paxUid:
			uid, err := strconv.ParseInt(v, 10, 0)
			if err != nil {
				return err
			}
			hdr.Uid = int(uid)
		case paxGid:
			gid, err := strconv.ParseInt(v, 10, 0)
			if err != nil {
				return err
			}
			hdr.Gid = int(gid)
		case paxAtime:
			t, err := parsePAXTime(v)
			if err != nil {
				return err
			}
			hdr.AccessTime = t
		case paxMtime:
			t, err := parsePAXTime(v)
			if err != nil {
				return err
			}
			hdr.ModTime = t
		case paxCtime:
			t, err := parsePAXTime(v)
			if err != nil {
				return err
			}
			hdr.ChangeTime = t
		case paxSize:
			size, err := strconv.ParseInt(v, 10, 0)
			if err != nil {
				return err
			}
			hdr.Size = int64(size)
		default:
			if strings.HasPrefix(k, paxXattr) {
				if hdr.Xattrs == nil {
					hdr.Xattrs = make(map[string]string)
				}
				hdr.Xattrs[k[len(paxXattr):]] = v
			}
		}
	}
	return nil
}
func mergePAX ( hdr * Header , headers map [ string ] string ) error { for k , v := range headers { switch k { case paxPath : hdr . Name = v case paxLinkpath : hdr . Linkname = v case paxGname : hdr . Gname = v case paxUname : hdr . Uname = v case paxUid : uid , err := strconv . ParseInt ( v , 10 , 0 ) if err != nil { return err } hdr . Uid = int ( uid ) case paxGid : gid , err := strconv . ParseInt ( v , 10 , 0 ) if err != nil { return err } hdr . Gid = int ( gid ) case paxAtime : t , err := parsePAXTime ( v ) if err != nil { return err } hdr . AccessTime = t case paxMtime : t , err := parsePAXTime ( v ) if err != nil { return err } hdr . ModTime = t case paxCtime : t , err := parsePAXTime ( v ) if err != nil { return err } hdr . ChangeTime = t case paxSize : size , err := strconv . ParseInt ( v , 10 , 0 ) if err != nil { return err } hdr . Size = int64 ( size ) default : if strings . HasPrefix ( k , paxXattr ) { if hdr . Xattrs == nil { hdr . Xattrs = make ( map [ string ] string ) } hdr . Xattrs [ k [ len ( paxXattr ) : ] ] = v } } } return nil }
mergePAX merges well known headers according to PAX standard.
mergePAX merges well known headers according to PAX standard .