Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
github.com/gauchemoss/project-progress-bar
In this project i have made a simple progressbar for golang.
You have to use the package manager go get for installing the progress bar:
go get github.com/Gauchemoss/Project-progress-bar/v1
package main
import (
"fmt"
v1 "github.com/Gauchemoss/Project-progress-bar/v1"
)
func main() {
nr_of_iterations := 3
v1.ProgressBar(nr_of_iterations, "*")
for i := 0; i < nr_of_iterations; i++ {
fmt.Println("hello world")
}
}
╔══════════════════════════════════════════════════╗
║**************************************************║ 100 % 3 / 3
╚══════════════════════════════════════════════════╝
Finished!!!
hello world
hello world
hello world
You could change the filling sign with what ever you want. If you just writing "", the program will use █ as default. A few examples could be seen below:
v1.ProgressBar(nr_of_iterations, "")
╔══════════════════════════════════════════════════╗
║██████████████████████████████████████████████████║ 100 % 3 / 3
╚══════════════════════════════════════════════════╝
v1.ProgressBar(nr_of_iterations, "#")
╔══════════════════════════════════════════════════╗
║##################################################║ 100 % 3 / 3
╚══════════════════════════════════════════════════╝
If you put in an value that is lesser or equal to 0 on nr_of_iterations, the program will write an error message to the terminal.
###Examples
nr_of_iterations := -3
v1.ProgressBar(nr_of_iterations, "")
###Result
Nr of loops must be positive integer over zero!!!
nr_of_iterations := 0
v1.ProgressBar(nr_of_iterations, "")
###Result
Nr of loops must be positive integer over zero!!!
You must set nr_of_iterations to an iteration, or your program will crash.
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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.