Skip to content

Commit

Permalink
[chore][receiver/hostmetrics] Fix lint on Windows issues (open-teleme…
Browse files Browse the repository at this point in the history
…try#29792)

**Description:**
Fixing lint issues when GOOS=windows. This is in preparation to
eventually include lint with GOOS=windows as part of CI.

**Link to tracking Issue:**
N/A

**Testing:**
`make` on component folder on a Windows box

**Documentation:**
N/A
  • Loading branch information
pjanotti committed Dec 13, 2023
1 parent 0e4cc0e commit a5b2501
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ type pageFileStats struct {
usedBytes uint64
freeBytes uint64
totalBytes uint64
cachedBytes *uint64 // Optional
cachedBytes *uint64 //nolint:unused
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,17 +43,17 @@ type systemInfo struct {

func getPageSize() uint64 {
var sysInfo systemInfo
procGetNativeSystemInfo.Call(uintptr(unsafe.Pointer(&sysInfo)))
procGetNativeSystemInfo.Call(uintptr(unsafe.Pointer(&sysInfo))) //nolint:errcheck
return uint64(sysInfo.dwPageSize)
}

// system type as defined in https://docs.microsoft.com/en-us/windows/win32/api/psapi/ns-psapi-enum_page_file_information
type enumPageFileInformation struct {
cb uint32
reserved uint32
cb uint32 //nolint:unused
reserved uint32 //nolint:unused
totalSize uint64
totalInUse uint64
peakUsage uint64
peakUsage uint64 //nolint:unused
}

func getPageFileStats() ([]*pageFileStats, error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func (m *handleCountManager) GetProcessHandleCount(pid int64) (uint32, error) {

type wmiHandleCountQueryer struct{}

//revive:disable-next-line:var-naming
type Win32_Process struct {
ProcessID int64
HandleCount uint32
Expand Down

0 comments on commit a5b2501

Please sign in to comment.