
Product
Introducing Rust Support in Socket
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
git.sr.ht/~liliace/pogs
A thread-safe go library for displaying multiple progress bars in unix terminals.
Progress bars typically clear and redraw the line as they update. Using a progress bar library not designed to display multiple progress bars to do so would cause each progress bar to rewrite each other.
The pogs library supports displaying multiple progress bars by moving and keeping track of the cursor position.
Additionally, the pogs library separates the method for creating a progress bar
into NewBar
and Start
to support use cases where
the jobs of the progress bar may complete before we know the number of the jobs
(see example below).
The pogs library depends on golang.org/x/sys
,
which hangs forever if you have GOPROXY=direct
in your environment.
Install with the cache proxy instead:
GOPROXY="" go get -u git.sr.ht/~liliace/pogs
In this example, we don't know the size of each progress bar
until after we have finished each inner loop.
We are still able to advance the progress bar data with bars.Add
before displaying it with bars.Start
.
bars, err := pogs.NewBars()
if err != nil {
log.Fatal(err)
}
for _ = range 5 {
id, _ := bars.NewBar()
size := 0
// consider root a pre-defined node of some linked-list
for curr := root; curr != nil; curr = curr.Next {
bars.Add(id)
size += 1
}
bars.Start(id, size)
}
bars.Done()
The id returned by bars.NewBar
is the id-th bar created,
so the loop above can be simplified to:
for i = range 5 {
bars.NewBar()
size := 0
for curr := root; curr != nil; curr = curr.Next {
bars.Add(i)
size += 1
}
bars.Start(i, size)
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.
Product
Socket’s precomputed reachability slashes false positives by flagging up to 80% of vulnerabilities as irrelevant, with no setup and instant results.
Product
Socket is launching experimental protection for Chrome extensions, scanning for malware and risky permissions to prevent silent supply chain attacks.