Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pkg/gpu/gpu_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func (i *Info) load() error {
// Building dynamic WHERE clause with addresses to create a single query collecting all desired data
queryAddresses := []string{}
for _, description := range win32VideoControllerDescriptions {
var queryAddres = strings.Replace(description.PNPDeviceID, "\\", `\\`, -1)
var queryAddres = strings.ReplaceAll(description.PNPDeviceID, "\\", `\\`)
queryAddresses = append(queryAddresses, "PNPDeviceID='"+queryAddres+"'")
}
whereClause := strings.Join(queryAddresses[:], " OR ")
Expand Down Expand Up @@ -85,7 +85,7 @@ func (i *Info) load() error {

func GetDevice(id string, entities []win32PnPEntity) *pci.Device {
// Backslashing PnP address ID as requested by JSON and VMI query: https://docs.microsoft.com/en-us/windows/win32/wmisdk/where-clause
var queryAddress = strings.Replace(id, "\\", `\\`, -1)
var queryAddress = strings.ReplaceAll(id, "\\", `\\`)
// Preparing default structure
var device = &pci.Device{
Address: queryAddress,
Expand Down
2 changes: 1 addition & 1 deletion pkg/memory/memory_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ func memTotalPhysicalBytesFromSyslog(paths *linuxpath.Paths) int64 {
for _, file := range logFiles {
if strings.HasPrefix(file.Name(), "syslog") {
fullPath := filepath.Join(logDir, file.Name())
unzip := strings.HasSuffix(file.Name(), ".gz")
unzip := filepath.Ext(file.Name()) == ".gz"
var r io.ReadCloser
r, err = os.Open(fullPath)
if err != nil {
Expand Down
Loading