Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/objects/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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{
Expand Down
2 changes: 1 addition & 1 deletion pkg/objects/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
5 changes: 0 additions & 5 deletions pkg/util/numeric.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}