move ReadFileNoStat to its own file - #222
Merged
Merged
Conversation
Closed
dmitshur
approved these changes
Oct 7, 2019
dmitshur
left a comment
There was a problem hiding this comment.
For what it's worth, my temporary local fix was bit-for-bit identical, down to same filename, same copyright header and year, other than the maxBufferSize diff:
$ diff <(git diff --cached) <(curl -sL 'https://github.com/prometheus/procfs/pull/222.diff')
3c3
< index 0000000..2a365a6
---
> index 00000000..8051161b
34c34
< + const maxBufferSize = 1024 * 500
---
> + const maxBufferSize = 1024 * 512
46c46
< index 8d8ac70..c07de0b 100644
---
> index 8d8ac700..c07de0b6 100644| // Reads a max file size of 512kB. For files larger than this, a scanner | ||
| // should be used. | ||
| func ReadFileNoStat(filename string) ([]byte, error) { | ||
| const maxBufferSize = 1024 * 512 |
There was a problem hiding this comment.
It might be worth mentioning in the commit message that this has changed (it was 1024 * 500 before).
Collaborator
Author
There was a problem hiding this comment.
Good idea, I updated it when I noticed that the comment didn't match the code, and forgot to mention this in the commit message.
This allows it to be built on all platforms Fixes prometheus#221. Also, updates the max size to 512k (instead of 500k) to match the comment. Signed-off-by: Paul Gier <pgier@redhat.com>
pgier
force-pushed
the
separate_file_readfilenostat
branch
from
October 7, 2019 06:57
0f8d9bf to
e973cdd
Compare
bobrik
pushed a commit
to bobrik/procfs
that referenced
this pull request
Jan 14, 2023
Pin object in CI to allow tests to run with rust 1.48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows it to be built on all platforms
Fixes #221