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

feat!: use generics for new progressbar creation #132

Closed
wants to merge 4 commits into from

Conversation

hexnaught
Copy link
Contributor

Changes to allow either int or int64 when calling various 'New' methods to create new progressbar instances.

items := make([]int, 999)
bar1 := progressbar.Default(len(items))
bar2 := progressbar.Default(int64(len(items)))

This is a breaking change as it requires Go v1.18 to make use of generics. May be worth stating this in the README above the installation title on v4 release.

## Requires

Progressbar V4 requires Go version v1.18 or later.

Note: Can't make methods generics (i.e. those bound to structs, ChangeMax, ChangeMax64 etc) due to limitations in current generics implementation with Go.

Resolves #129

Changes to allow either int or int64 when calling various 'New' methods
to create new progressbar instances.
This is a breaking change and requires Go v1.18 to make use of generics.
@schollz schollz closed this Feb 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consume int for new progress bar
2 participants