diff --git a/pkg/objects/github.go b/pkg/objects/github.go index 160d0b12..e2f50778 100644 --- a/pkg/objects/github.go +++ b/pkg/objects/github.go @@ -137,7 +137,7 @@ func (s *GithubReleaseSource) ListAllFiles(ctx context.Context, out chan<- FileS fs := FileSpec{ Path: fmt.Sprintf("%s/%s", r.TagName, a.Name), DownloadPath: a.DownloadURL, - LastModified: util.PointerTo(a.UpdatedAt), + LastModified: new(a.UpdatedAt), } out <- fs } @@ -189,7 +189,7 @@ func (s *GithubReleaseSource) GetFile(ctx context.Context, path string, requestH if resp.ContentLength < 0 { sizeBytes = nil } else { - sizeBytes = util.PointerTo(util.AtLeastZero(resp.ContentLength)) + sizeBytes = new(util.AtLeastZero(resp.ContentLength)) } return resp.Body, FileState{ diff --git a/pkg/objects/source.go b/pkg/objects/source.go index 848eab79..a7e867a0 100644 --- a/pkg/objects/source.go +++ b/pkg/objects/source.go @@ -355,7 +355,7 @@ func (u URLSource) GetFile(ctx context.Context, filePath string, requestHeaders if resp.ContentLength < 0 { sizeBytes = nil } else { - sizeBytes = util.PointerTo(util.AtLeastZero(resp.ContentLength)) + sizeBytes = new(util.AtLeastZero(resp.ContentLength)) } return resp.Body, FileState{ diff --git a/pkg/util/numeric.go b/pkg/util/numeric.go index 36e4758f..2b548b49 100644 --- a/pkg/util/numeric.go +++ b/pkg/util/numeric.go @@ -11,8 +11,3 @@ func AtLeastZero[I interface{ int | int64 }](x I) uint64 { } return uint64(x) } - -// PointerTo constructs a pointer to a provided value. -func PointerTo[T any](value T) *T { - return &value -}