[disk][process][freebsd]: remove binary.go from common - #1907
Merged
Conversation
shirou
force-pushed
the
feat/remove_binary_go_file
branch
from
August 26, 2025 14:27
a735ba7 to
7320b80
Compare
shirou
force-pushed
the
feat/remove_binary_go_file
branch
from
August 26, 2025 14:38
7320b80 to
2758ffc
Compare
1 task
freebsd-git
pushed a commit
to freebsd/freebsd-ports
that referenced
this pull request
Sep 3, 2025
Patch a bug in gopsutil used by telegraf, thas was fixed upstreams but has not yet been released. This copies the patch from gopsutil's PR 1907. [1] Link: shirou/gopsutil#1907 [1] PR: 289207
camachat
pushed a commit
to camachat/freebsd-ports
that referenced
this pull request
Jul 22, 2026
Patch a bug in gopsutil used by telegraf, thas was fixed upstreams but has not yet been released. This copies the patch from gopsutil's PR 1907. [1] Link: shirou/gopsutil#1907 [1] PR: 289207
camachat
pushed a commit
to camachat/freebsd-ports
that referenced
this pull request
Jul 24, 2026
Patch a bug in gopsutil used by telegraf, thas was fixed upstreams but has not yet been released. This copies the patch from gopsutil's PR 1907. [1] Link: shirou/gopsutil#1907 [1] PR: 289207
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 PR fixes #1898.
Background
The FreeBSD
devstatstruct is generated from the Cdevstatstructure using Go’s cgo tool. However, this results in a field defined asID *byte(a pointer to byte).When using
binary.Readon a struct that contains pointer fields, it returns an"invalid type"error.For that reason, we previously modified
binary.goto handlereflect.Ptrand kept that modified version in the repository.Approach in this PR
That said, I don’t think maintaining code from the standard library is a good practice. In this PR, I’ve manually changed
*byteto[sizeofPtr]byte. SincesizeofPtrvaries depending on the architecture, this ensures that the struct has a consistent byte size across architectures and allowsbinary.Readto work properly. Thus, we can removebinary.gofrom this repository.