Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/Gauchemoss/Project-progress-bar

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/Gauchemoss/Project-progress-bar

  • v0.0.0-20210518092003-bde66cb4e283
  • Source
  • Go
  • Socket score

Version published
Created
Source

Project-progress-bar

In this project i have made a simple progressbar for golang.

Installation

You have to use the package manager go get for installing the progress bar:

go get github.com/Gauchemoss/Project-progress-bar/v1

Example for using:

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")
    }
}

Result:

╔══════════════════════════════════════════════════╗
║**************************************************║ 100 %    3 / 3
╚══════════════════════════════════════════════════╝
Finished!!!

hello world
hello world
hello world

Functionalities

1

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:

Examples

v1.ProgressBar(nr_of_iterations, "")
Result
╔══════════════════════════════════════════════════╗
║██████████████████████████████████████████████████║ 100 %    3 / 3
╚══════════════════════════════════════════════════╝
v1.ProgressBar(nr_of_iterations, "#")
Result
╔══════════════════════════════════════════════════╗
║##################################################║ 100 %    3 / 3
╚══════════════════════════════════════════════════╝

2

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!!!

OBS!!!

You must set nr_of_iterations to an iteration, or your program will crash.

FAQs

Package last updated on 18 May 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc