| 1 |
// Copyright 2020 The Go Authors. All rights reserved. |
| 2 |
// Use of this source code is governed by a BSD-style |
| 3 |
// license that can be found in the LICENSE file. |
| 4 |
|
| 5 |
// Package sysinfo implements high level hardware information gathering |
| 6 |
// that can be used for debugging or information purposes. |
| 7 |
package sysinfo |
| 8 |
|
| 9 |
import ( |
| 10 |
"internal/cpu" |
| 11 |
"sync" |
| 12 |
) |
| 13 |
|
| 14 |
var CPUName = sync.OnceValue(func() string { |
| 15 |
if name := cpu.Name(); name != "" { |
| 16 |
return name |
| 17 |
} |
| 18 |
|
| 19 |
if name := osCPUInfoName(); name != "" { |
| 20 |
return name |
| 21 |
} |
| 22 |
|
| 23 |
return "" |
| 24 |
}) |