]> Cypherpunks repositories - gostls13.git/commit
archive/tar: populate uname/gname/devmajor/devminor in FileInfoHeader
authorJoe Tsai <joetsai@digital-static.net>
Mon, 28 Aug 2017 23:25:56 +0000 (16:25 -0700)
committerJoe Tsai <thebrokentoaster@gmail.com>
Wed, 30 Aug 2017 00:52:31 +0000 (00:52 +0000)
commit0564e304a6ea394a42929060c588469dbd6f32af
tree0a06f26deea10ff5ac8388a016ca9eb508c8e419
parent93da0b6e66f24c4c307e0df37ceb102a33306174
archive/tar: populate uname/gname/devmajor/devminor in FileInfoHeader

We take a best-effort approach since information for these fields
are not well supported on all platforms.

user.LookupId+user.LookupGroupId is currently 15x slower than os.Stat.
For performance reasons, we perpetually cache username and groupname
with a sync.Map. As a result, this function will not be updated whenever
the user or group names are renamed in the OS. However, this is a better
situation than before, where those fields were not populated at all.

Change-Id: I3cec8291aed7675dea89ee1cbda92bd493c8831f
Reviewed-on: https://go-review.googlesource.com/59531
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/archive/tar/stat_unix.go
src/go/build/deps_test.go