Skip to content

Commit

Permalink
fix: variable name conflicts with built in function
Browse files Browse the repository at this point in the history
Signed-off-by: Terry Howe <[email protected]>
  • Loading branch information
TerryHowe committed Jul 18, 2024
1 parent 9e5e766 commit 958e7e6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions cmd/oras/internal/display/status/progress/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,17 +92,17 @@ func (m *manager) render() {
defer m.statusLock.RUnlock()
// todo: update size in another routine
width, height := m.console.Size()
len := len(m.status) * 2
statusLength := len(m.status) * 2
offset := 0
if len > height {
if statusLength > height {
// skip statuses that cannot be rendered
offset = len - height
offset = statusLength - height

Check warning on line 99 in cmd/oras/internal/display/status/progress/manager.go

View check run for this annotation

Codecov / codecov/patch

cmd/oras/internal/display/status/progress/manager.go#L99

Added line #L99 was not covered by tests
}

for ; offset < len; offset += 2 {
for ; offset < statusLength; offset += 2 {
status, progress := m.status[offset/2].String(width)
m.console.OutputTo(uint(len-offset), status)
m.console.OutputTo(uint(len-offset-1), progress)
m.console.OutputTo(uint(statusLength-offset), status)
m.console.OutputTo(uint(statusLength-offset-1), progress)
}
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/oras/internal/display/status/progress/status_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func Test_status_String(t *testing.T) {
}
}

func Test_status_String_zeroWitdth(t *testing.T) {
func Test_status_String_zeroWidth(t *testing.T) {
// zero status and progress
s := newStatus()
if status, digest := s.String(console.MinWidth); status != zeroStatus || digest != zeroDigest {
Expand Down

0 comments on commit 958e7e6

Please sign in to comment.