Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move ReadFileNoStat to its own file #222

Merged
merged 1 commit into from Oct 7, 2019

Conversation

@pgier
Copy link
Collaborator

commented Oct 7, 2019

This allows it to be built on all platforms
Fixes #221

@pgier pgier referenced this pull request Oct 7, 2019
Copy link

left a 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

This comment has been minimized.

Copy link
@dmitshur

dmitshur Oct 7, 2019

It might be worth mentioning in the commit message that this has changed (it was 1024 * 500 before).

This comment has been minimized.

Copy link
@pgier

pgier Oct 7, 2019

Author Collaborator

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 #221.
Also, updates the max size to 512k (instead of 500k) to match the comment.

Signed-off-by: Paul Gier <pgier@redhat.com>
@pgier pgier force-pushed the pgier:separate_file_readfilenostat branch from 0f8d9bf to e973cdd Oct 7, 2019
@SuperQ
SuperQ approved these changes Oct 7, 2019
Copy link
Member

left a comment

LGTM

@pgier pgier merged commit aee1427 into prometheus:master Oct 7, 2019
6 checks passed
6 checks passed
DCO DCO
Details
ci/circleci: codespell Your tests passed on CircleCI!
Details
ci/circleci: linux-1-11 Your tests passed on CircleCI!
Details
ci/circleci: linux-1-12 Your tests passed on CircleCI!
Details
ci/circleci: windows-1-11 Your tests passed on CircleCI!
Details
ci/circleci: windows-1-12 Your tests passed on CircleCI!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.