https://github.com/bitcav/go-memdev
Golang memory devices information :package:
https://github.com/bitcav/go-memdev
dimm go golang hardware memory ram
Last synced: 3 months ago
JSON representation
Golang memory devices information :package:
- Host: GitHub
- URL: https://github.com/bitcav/go-memdev
- Owner: bitcav
- License: mit
- Created: 2020-08-08T01:46:08.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-14T01:18:50.000Z (almost 5 years ago)
- Last Synced: 2025-04-11T23:53:08.578Z (3 months ago)
- Topics: dimm, go, golang, hardware, memory, ram
- Language: Go
- Homepage:
- Size: 43 KB
- Stars: 15
- Watchers: 3
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()

[](https://goreportcard.com/report/github.com/bitcav/go-memdev)
[](https://godoc.org/github.com/bitcav/go-memdev)
[](https://travis-ci.org/bitcav/go-memdev)

[](https://github.com/bitcav/go-memdev/blob/master/LICENSE)
# go-memdevA Go package that access to **Memory Devices** information.
## Installation
```
go get -u github.com/bitcav/go-memdev
```## Usage
```go
package mainimport (
"encoding/json"
"fmt""github.com/bitcav/go-memdev"
)func main() {
memInfo, _ := memdev.Info() //the returned value is a structjsonOutput, _ := json.MarshalIndent(memInfo, "", " ")
fmt.Println(string(jsonOutput))
}```
The output is below.
```json
[
{
"bank": "DIMM A",
"size": 4096,
"unit": "MB",
"type": "FBD2",
"formFactor": "SODIMM",
"manufacturer": "Samsung",
"serial": "A49F8D93",
"assetTag": "03153300",
"partNumber": "M471B5173DB0-YK0 ",
"speed": 1600,
"dataWidth": 64,
"totalWidth": 64
}
]```
## Running
### Build
```
go build
```### Run
:lock: In order to access the system BIOS requires running with elevated privileges.* Linux:
```
sudo ./main
```* Windows:
You can launch the program as an administrator by right-clicking on the executable file and choosing "Run as administrator."