diff --git a/pkg/stargazer/errors.go b/pkg/stargazer/errors.go index 97ff3d0..c92140b 100644 --- a/pkg/stargazer/errors.go +++ b/pkg/stargazer/errors.go @@ -3,7 +3,6 @@ package stargazer import ( "errors" "fmt" - "math" ) var ErrNoEntries = errors.New("invalid STAR file - no file entries found") @@ -19,10 +18,6 @@ type ( Filename string } - ErrFileTooLarge struct { - Filename string - } - ErrNotAFile struct { Filename string } @@ -40,10 +35,6 @@ func (e ErrFilenameTooLong) Error() string { return fmt.Sprintf("filename '%s' is too long, needs to be < %d characters.", e.Filename, MaxFilenameSize) } -func (e ErrFileTooLarge) Error() string { - return fmt.Sprintf("file '%s' is too large, needs to be < %d bytes.", e.Filename, uint32(math.MaxUint32)) -} - func (e ErrNotAFile) Error() string { return fmt.Sprintf("'%s' is not a file.", e.Filename) } diff --git a/pkg/stargazer/stargazer.go b/pkg/stargazer/stargazer.go index 2413a84..484017b 100644 --- a/pkg/stargazer/stargazer.go +++ b/pkg/stargazer/stargazer.go @@ -7,7 +7,6 @@ import ( "encoding/hex" "fmt" "io" - "math" "os" "path/filepath" "strings" @@ -185,12 +184,6 @@ func NewEntryFromFile(dir string, f string) (*Entry, error) { return nil, err } - if len(entry.Content) > math.MaxUint32 { - return nil, ErrFileTooLarge{ - Filename: filename, - } - } - entry.Header.Filesize = uint32(len(entry.Content)) entry.Header.Headersize = uint8(1 + 1 + 4 + 1 + 1 + len(entry.Filename))