]> Cypherpunks repositories - gostls13.git/commit
archive/tar: implement specialized logic for USTAR format
authorJoe Tsai <joetsai@digital-static.net>
Fri, 11 Aug 2017 05:34:51 +0000 (22:34 -0700)
committerJoe Tsai <thebrokentoaster@gmail.com>
Sat, 12 Aug 2017 01:48:06 +0000 (01:48 +0000)
commit0d1a8f6e12770db8982ed23bc67228237671085d
treec0de4c4413375894fd825e937bd906ccb0234a67
parent812124a56758175ecd19a3dc0ae261bb02969d9c
archive/tar: implement specialized logic for USTAR format

Rather than going through the complicated logic of writeHeader,
implement a writeUSTARHeader that only knows about the USTAR format.
This makes the logic much easier to reason about since you only
need to be concerned about USTAR and not all the subtle
differences between USTAR, PAX, and GNU.

We seperate out the logic in writeUSTARHeader into templateV7Plus
and writeRawHeader since the planned implementations of
writePAXHeader and writeGNUHeader will use them.

Change-Id: Ie75a54ac998420ece82686159ae6fa39f8b128e9
Reviewed-on: https://go-review.googlesource.com/54970
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/archive/tar/format.go
src/archive/tar/writer.go