- A decoder for dmidecode output
- Create a new dmidecode struct
import "github.com/rawdaGastan/dmidecode/pkg"
dmi := pkg.NewDMIDecoder()
- Get the dmidecode output
output, _ := dmi.GetDMIDecodeOutput()
- Then decode it
dmi.Decode(output)
dmiDecode.Decode()
→ to get your decoded mapdmiDecode.GetSections()
→ to get your sections' namesdmiDecode.GetSection( sectionKey )
→ to get the content of the specified section keydmiDecode.GetOptions( sectionKey )
→ to get the options of the specified section keydmiDecode.Get( sectionKey, optionKey )
→ to get the string value of an option key inside a sectiondmiDecode.GetList( sectionKey, optionKey )
→ to get the list value of an option key inside a section
Use this command to run the tests
go test -v ./...
task test
make test
- create a
coverage
folder - Use this command to see the coverage
mkdir coverage
go test -v ./... -coverprofile=coverage/coverage.out
go tool cover -html=coverage/coverage.out -o coverage/coverage.html
task coverage
make coverage
- Open coverage/coverage.html to trace the coverage
Use this command to run the tests
go test -v ./... -bench=. -count 1 -benchtime=10s -benchmem -run=^#
make benchmarks
task benchmarks