schollz / schollz/progressbar

Bad size value with (fs.FileInfo).Size() on parameter

Open
#162 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
4.7k
Forks
258
Avg merge
13h 31m
Merged PRs (30d)
1

Description

Hello,
thanks for this library.
I use this to have a progress bar when I read a file, but I have a little bug.
I call file.Stat() to have the file size and I put on progressbar.
image
The problem is that the size value I pass as a parameter and the size displayed in the progress bar are not the same.
The size file is 159MB but the progress bar display 152MB.
image

I don't know why this difference exist.

Also, If i call bar.Finish() on the end of my process, the total size become huge.
image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is identified in the report. Reproduce the mismatch starting from file.Stat() and the progress-bar size parameter, then check the behavior of bar.Finish(); done means the reported total is consistent in both cases and the observed discrepancy has a documented regression test or a clear explanation.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.