GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - bool64/progress: Progress printer for Go

BranchesTags
Open more actions menu

Latest commit

 

History

48 Commits
48 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
cmd/catp
cmd/catp
 
 
.gitignore
.gitignore
 
 
.golangci.yml
.golangci.yml
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
dev_test.go
dev_test.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
progress.go
progress.go
 
 

Repository files navigation

progress

Build Status Coverage Status GoDevDoc Time Tracker Code lines Comments

This library instruments io.Reader/io.Writer with progress printer.

Usage

See catp for an example.

var pr = &progress.Progress{
	Interval: 5 * time.Second,
	Print: func(status progress.ProgressStatus) {
		println(Status(status))
	},
}

func cat(filename string) {
	file, err := os.Open(filename)
	if err != nil {
		log.Fatal(err)
	}
	defer file.Close()

	st, err := file.Stat()
	if err != nil {
		log.Fatalf("failed to read file stats %s: %s", filename, err)
	}

	cr := &progress.CountingReader{Reader: file}

	pr.Start(st.Size, cr.Bytes, cr.Lines, filename)
	defer pr.Stop()

	readFile(cr)
}

About

Progress printer for Go

Topics

hacktoberfest

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Used by

Contributors

Languages

Generated from bool64/go-template
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.