From 8a361ef0d867413199594d9f564d0acd1053244b Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Thu, 24 Sep 2015 09:51:58 -0400 Subject: [PATCH] tar/storage: Sprintf is unnecessary fmt.Sprintf() vs string() for this []byte conversion is too much and does not provide any further safety. https://gist.github.com/vbatts/ab17181086aed558dd3a --- tar/storage/entry.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tar/storage/entry.go b/tar/storage/entry.go index a152ac2..b61758e 100644 --- a/tar/storage/entry.go +++ b/tar/storage/entry.go @@ -1,10 +1,6 @@ package storage -import ( - "fmt" - - "github.com/vbatts/tar-split/tar/common" -) +import "github.com/vbatts/tar-split/tar/common" // Entries is for sorting by Position type Entries []Entry @@ -68,7 +64,7 @@ func (e *Entry) SetNameBytes(name []byte) { // GetName returns the string for the entry's name, regardless of the field stored in func (e *Entry) GetName() string { if len(e.NameRaw) > 0 { - return fmt.Sprintf("%s", e.NameRaw) + return string(e.NameRaw) } return e.Name }