aboutsummaryrefslogtreecommitdiff
path: root/.gitignore
diff options
context:
space:
mode:
authorJoe Tsai <joetsai@digital-static.net>2015-09-17 00:22:56 -0700
committerBrad Fitzpatrick <bradfitz@golang.org>2016-05-06 00:57:22 +0000
commit30bfafc319288e8cfe54111664e3f2f259998a0a (patch)
tree85cdb9b25265e21145f417861aa49aa25ea5da90 /.gitignore
parent88d3db0a5b5196ed45c96014d5a2d32e4e41e34e (diff)
downloadgo-30bfafc319288e8cfe54111664e3f2f259998a0a.tar.gz
go-30bfafc319288e8cfe54111664e3f2f259998a0a.zip
archive/tar: centralize all information about tar header format
The Reader and Writer have hard-coded constants regarding the offsets and lengths of certain fields in the tar format sprinkled all over. This makes it harder to verify that the offsets are correct since a reviewer would need to search for them throughout the code. Instead, all information about the layout of header fields should be centralized in one single file. This has the advantage of being both centralized, and also acting as a form of documentation about the header struct format. This method was chosen over using "encoding/binary" since that method would cause an allocation of a header struct every time binary.Read was called. This method causes zero allocations and its logic is no longer than if structs were declared. Updates #12594 Change-Id: Ic7a0565d2a2cd95d955547ace3b6dea2b57fab34 Reviewed-on: https://go-review.googlesource.com/14669 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to '.gitignore')
0 files changed, 0 insertions, 0 deletions