Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: slice bounds out of range on select printer #420

Merged

Conversation

mponton
Copy link
Contributor

@mponton mponton commented Nov 18, 2022

Closes #419

Description

Update InteractiveSelectPrinter.Show to fix out of range issue on Options slice when DefaultOption is set and its index is within maxHeight of the end of the Options array.

Scope

What is affected by this pull request?

  • Bug Fix
  • New Feature
  • Documentation
  • Other

Related Issue

Fixes #419

To-Do Checklist

  • I tested my changes
  • I have commented every method that I created/changed
  • I updated the examples to fit with my changes
  • I have updated tests for my newly modified methods

@codecov
Copy link

codecov bot commented Nov 18, 2022

Codecov Report

Merging #420 (8ff8b73) into master (e996926) will increase coverage by 0.42%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #420      +/-   ##
==========================================
+ Coverage   81.10%   81.53%   +0.42%     
==========================================
  Files          29       29              
  Lines        2101     2101              
==========================================
+ Hits         1704     1713       +9     
+ Misses        380      371       -9     
  Partials       17       17              
Impacted Files Coverage Δ
interactive_select_printer.go 52.73% <100.00%> (+6.16%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Member

@MarvinJWendt MarvinJWendt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small comment, thanks for the PR! The fix looks good to me 😄

interactive_select_printer_test.go Outdated Show resolved Hide resolved
Copy link
Member

@MarvinJWendt MarvinJWendt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for contributing 🚀

@MarvinJWendt MarvinJWendt merged commit 9784769 into pterm:master Nov 22, 2022
renovate bot added a commit to defenseunicorns/zarf that referenced this pull request Nov 23, 2022
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/pterm/pterm](https://togithub.com/pterm/pterm) | require |
patch | `v0.12.49` -> `v0.12.50` |

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the
Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>pterm/pterm</summary>

### [`v0.12.50`](https://togithub.com/pterm/pterm/releases/tag/v0.12.50)

[Compare
Source](https://togithub.com/pterm/pterm/compare/v0.12.49...v0.12.50)

<!-- Release notes generated using configuration in .github/release.yml
at master -->

#### What's Changed

##### Fixes 🔧

- fix: slice bounds out of range on select printer by
[@&#8203;mponton](https://togithub.com/mponton) in
[pterm/pterm#420

##### Other Changes

- chore(ci): remove macos from matrix by
[@&#8203;rafaelrubbioli](https://togithub.com/rafaelrubbioli) in
[pterm/pterm#412

#### New Contributors

- [@&#8203;rafaelrubbioli](https://togithub.com/rafaelrubbioli) made
their first contribution in
[pterm/pterm#412
- [@&#8203;mponton](https://togithub.com/mponton) made their first
contribution in
[pterm/pterm#420

**Full Changelog**:
pterm/pterm@v0.12.49...v0.12.50

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/defenseunicorns/zarf).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yOS4yIiwidXBkYXRlZEluVmVyIjoiMzQuMjkuMiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
sheldonhull added a commit to DelineaXPM/ansible-core-collection that referenced this pull request Nov 23, 2022
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/pterm/pterm](https://togithub.com/pterm/pterm) | require |
patch | `v0.12.49` -> `v0.12.50` |

---

### Release Notes

<details>
<summary>pterm/pterm</summary>

### [`v0.12.50`](https://togithub.com/pterm/pterm/releases/tag/v0.12.50)

[Compare
Source](https://togithub.com/pterm/pterm/compare/v0.12.49...v0.12.50)

<!-- Release notes generated using configuration in .github/release.yml
at master -->

#### What's Changed

##### Fixes 🔧

- fix: slice bounds out of range on select printer by
[@&#8203;mponton](https://togithub.com/mponton) in
[pterm/pterm#420

##### Other Changes

- chore(ci): remove macos from matrix by
[@&#8203;rafaelrubbioli](https://togithub.com/rafaelrubbioli) in
[pterm/pterm#412

#### New Contributors

- [@&#8203;rafaelrubbioli](https://togithub.com/rafaelrubbioli) made
their first contribution in
[pterm/pterm#412
- [@&#8203;mponton](https://togithub.com/mponton) made their first
contribution in
[pterm/pterm#420

**Full Changelog**:
pterm/pterm@v0.12.49...v0.12.50

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click
this checkbox.

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yMjkuMCIsInVwZGF0ZWRJblZlciI6IjMyLjIyOS4wIn0=-->

Co-authored-by: mend-for-github-com[bot] <50673670+mend-for-github-com[bot]@users.noreply.github.com>
Co-authored-by: Sheldon Hull <sheldonhull@users.noreply.github.com>
mend-for-github-com bot added a commit to DelineaXPM/terraform-provider-dsv that referenced this pull request Dec 8, 2022
…50 (#38)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/pterm/pterm](https://togithub.com/pterm/pterm) | require |
patch | `v0.12.49` -> `v0.12.50` |

---

### Release Notes

<details>
<summary>pterm/pterm</summary>

### [`v0.12.50`](https://togithub.com/pterm/pterm/releases/tag/v0.12.50)

[Compare
Source](https://togithub.com/pterm/pterm/compare/v0.12.49...v0.12.50)

<!-- Release notes generated using configuration in .github/release.yml
at master -->

#### What's Changed

##### Fixes 🔧

- fix: slice bounds out of range on select printer by
[@&#8203;mponton](https://togithub.com/mponton) in
[pterm/pterm#420

##### Other Changes

- chore(ci): remove macos from matrix by
[@&#8203;rafaelrubbioli](https://togithub.com/rafaelrubbioli) in
[pterm/pterm#412

#### New Contributors

- [@&#8203;rafaelrubbioli](https://togithub.com/rafaelrubbioli) made
their first contribution in
[pterm/pterm#412
- [@&#8203;mponton](https://togithub.com/mponton) made their first
contribution in
[pterm/pterm#420

**Full Changelog**:
pterm/pterm@v0.12.49...v0.12.50

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 3am on Monday" (UTC),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click
this checkbox.

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4yMjkuMCIsInVwZGF0ZWRJblZlciI6IjMyLjIyOS4wIn0=-->

Co-authored-by: mend-for-github-com[bot] <50673670+mend-for-github-com[bot]@users.noreply.github.com>
Noxsios pushed a commit to defenseunicorns/zarf that referenced this pull request Mar 8, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/pterm/pterm](https://togithub.com/pterm/pterm) | require |
patch | `v0.12.49` -> `v0.12.50` |

---

### ⚠ Dependency Lookup Warnings ⚠

Warnings were logged while processing this repo. Please check the
Dependency Dashboard for more information.

---

### Release Notes

<details>
<summary>pterm/pterm</summary>

### [`v0.12.50`](https://togithub.com/pterm/pterm/releases/tag/v0.12.50)

[Compare
Source](https://togithub.com/pterm/pterm/compare/v0.12.49...v0.12.50)

<!-- Release notes generated using configuration in .github/release.yml
at master -->

#### What's Changed

##### Fixes 🔧

- fix: slice bounds out of range on select printer by
[@&#8203;mponton](https://togithub.com/mponton) in
[pterm/pterm#420

##### Other Changes

- chore(ci): remove macos from matrix by
[@&#8203;rafaelrubbioli](https://togithub.com/rafaelrubbioli) in
[pterm/pterm#412

#### New Contributors

- [@&#8203;rafaelrubbioli](https://togithub.com/rafaelrubbioli) made
their first contribution in
[pterm/pterm#412
- [@&#8203;mponton](https://togithub.com/mponton) made their first
contribution in
[pterm/pterm#420

**Full Changelog**:
pterm/pterm@v0.12.49...v0.12.50

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/defenseunicorns/zarf).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yOS4yIiwidXBkYXRlZEluVmVyIjoiMzQuMjkuMiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic with slice bounds out of range on select printer with default option
2 participants