MCPcopy
hub / github.com/jaypipes/ghw / New

Function New

pkg/cpu/cpu.go:141–148  ·  view source on GitHub ↗

New returns a pointer to an Info struct that contains information about the CPUs on the host system

(args ...any)

Source from the content-addressed store, hash-verified

139// New returns a pointer to an Info struct that contains information about the
140// CPUs on the host system
141func New(args ...any) (*Info, error) {
142 ctx := config.ContextFromArgs(args...)
143 info := &Info{}
144 if err := info.load(ctx); err != nil {
145 return nil, err
146 }
147 return info, nil
148}
149
150// String returns a short string indicating a summary of CPU information
151func (i *Info) String() string {

Callers 5

HostFunction · 0.92
TestCPUFunction · 0.92
TestArmCPUFunction · 0.92
TestS390xCPUFunction · 0.92

Calls 2

loadMethod · 0.95
ContextFromArgsFunction · 0.92

Tested by 4

TestCPUFunction · 0.74
TestArmCPUFunction · 0.74
TestS390xCPUFunction · 0.74