mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-03-13 19:01:09 -04:00
15 lines
259 B
Go
15 lines
259 B
Go
package sysinfo
|
|
|
|
import "os"
|
|
|
|
// PhysicalMemoryBytes returns the total amount of host memory.
|
|
func PhysicalMemoryBytes() (uint64, error) {
|
|
f, err := os.Open("/proc/meminfo")
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
defer f.Close()
|
|
|
|
return parseProcMeminfo(f)
|
|
}
|