Skip to content

archive/tar: decide before go1.22 whether the FileInfoNames interface is Unix-only use #65245

@qiulaidongfeng

Description

@qiulaidongfeng

Update : #65245 (comment) And #65245 (comment)

#50102 add FileInfoNames interface to archive/tar
I in August 2023 by https://go-review.googlesource.com/c/go/+/514235 wrote an implementation for the proposal

(My CL only has a complete implementation for changing FileInfoHeader behavior on unix.)

See https://pkg.go.dev/os/user#User , seems that there is no guarantee that uid and gid for non Unix systems are of type int.

This need to be resolved before go1.22 is released, in case it cannot be resolved in a backward compatible way in the future.

Possible solutions:

  1. Modify https://github.com/golang/go/blob/master/src/archive/tar/common.go#L645C1-L647C45 and https://github.com/golang/go/blob/master/src/archive/tar/common.go#L742C1-L743C34, said change FileInfoHeader behaviors on Unix only. This is the easiest.
  2. Delete the existing FileInfoNames interface in go1.22 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions