You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As procfs already using parseX(io.Reader) functions for parsing proc filesystem files, some functions also do syscall to read the target file' content. The main pitfall of this is that procfs enforce us to use this package only on Linux. For the people who want to make some stuff using this package on other OS environments, it's slightly difficult.
Proposal
Separate core parsing functions: (i.e. os.Open and parsing logic should not be allowed in same function)
These functions should NOT do any syscall (or depend on)
All functions should accept an input arg: io.Reader or []byte
Motivation
As
procfs
already usingparseX(io.Reader)
functions for parsing proc filesystem files, some functions also do syscall to read the target file' content. The main pitfall of this is that procfs enforce us to use this package only on Linux. For the people who want to make some stuff using this package on other OS environments, it's slightly difficult.Proposal
os.Open
and parsing logic should not be allowed in same function)io.Reader
or[]byte
Example
FS
. If received is really required during the parsing stage, keep it as-is for now1. If we about to keep those as private
Anyone who want to just access parser functions, have to use
go:linkname
directive as like the following:2. If we about to keep those as Public
go:linkname
directive3. Depend on a receiver or some function that do syscalls
We simply have to do CTRL+C/CTRL+V the actual logic. Which is decreasing the overall UX of the package.
Tracking (Merge Status)
Waiting your thoughts! I can make this issue as a tracking issue, if it does make sense in overall!
The text was updated successfully, but these errors were encountered: