mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
20 lines
387 B
Go
20 lines
387 B
Go
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
//go:build darwin
|
|
|
|
package platform
|
|
|
|
import (
|
|
"golang.org/x/sys/unix"
|
|
)
|
|
|
|
// getTotalMemory returns the total system memory in bytes.
|
|
func getTotalMemory() (uint64, error) {
|
|
mem, err := unix.SysctlUint64("hw.memsize")
|
|
if err != nil {
|
|
return 0, err
|
|
}
|
|
return mem, nil
|
|
}
|