aboutsummaryrefslogtreecommitdiff
path: root/src/archive
diff options
context:
space:
mode:
authorIskander Sharipov <iskander.sharipov@intel.com>2018-07-11 23:45:57 +0300
committerJoe Tsai <thebrokentoaster@gmail.com>2018-08-21 01:47:17 +0000
commit89d533e368395a5ba3157d9a89d346dd7b50ba51 (patch)
treeab4859e955f84684929f6626f3b198a57a34a28f /src/archive
parent692307aa839252285ebb91b4072e3c05ff554341 (diff)
downloadgo-89d533e368395a5ba3157d9a89d346dd7b50ba51.tar.gz
go-89d533e368395a5ba3157d9a89d346dd7b50ba51.zip
archive/tar: remore redundant parens in type expressions
Simplify `(T)` expressions to `T` where possible. Found using https://go-critic.github.io/overview.html#typeUnparen-ref Change-Id: Ic5ef335e03898f9fea1ff90fd83956376657fe67 Reviewed-on: https://go-review.googlesource.com/123379 Run-TryBot: Iskander Sharipov <iskander.sharipov@intel.com> Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Diffstat (limited to 'src/archive')
-rw-r--r--src/archive/tar/format.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/archive/tar/format.go b/src/archive/tar/format.go
index 1f89d0c59a..cfe24a5e1d 100644
--- a/src/archive/tar/format.go
+++ b/src/archive/tar/format.go
@@ -160,7 +160,7 @@ func (b *block) V7() *headerV7 { return (*headerV7)(b) }
func (b *block) GNU() *headerGNU { return (*headerGNU)(b) }
func (b *block) STAR() *headerSTAR { return (*headerSTAR)(b) }
func (b *block) USTAR() *headerUSTAR { return (*headerUSTAR)(b) }
-func (b *block) Sparse() sparseArray { return (sparseArray)(b[:]) }
+func (b *block) Sparse() sparseArray { return sparseArray(b[:]) }
// GetFormat checks that the block is a valid tar header based on the checksum.
// It then attempts to guess the specific format based on magic values.
@@ -263,7 +263,7 @@ func (h *headerGNU) DevMajor() []byte { return h[329:][:8] }
func (h *headerGNU) DevMinor() []byte { return h[337:][:8] }
func (h *headerGNU) AccessTime() []byte { return h[345:][:12] }
func (h *headerGNU) ChangeTime() []byte { return h[357:][:12] }
-func (h *headerGNU) Sparse() sparseArray { return (sparseArray)(h[386:][:24*4+1]) }
+func (h *headerGNU) Sparse() sparseArray { return sparseArray(h[386:][:24*4+1]) }
func (h *headerGNU) RealSize() []byte { return h[483:][:12] }
type headerSTAR [blockSize]byte
@@ -293,7 +293,7 @@ func (h *headerUSTAR) Prefix() []byte { return h[345:][:155] }
type sparseArray []byte
-func (s sparseArray) Entry(i int) sparseElem { return (sparseElem)(s[i*24:]) }
+func (s sparseArray) Entry(i int) sparseElem { return sparseElem(s[i*24:]) }
func (s sparseArray) IsExtended() []byte { return s[24*s.MaxEntries():][:1] }
func (s sparseArray) MaxEntries() int { return len(s) / 24 }