| Server IP : 157.230.181.24 / Your IP : 216.73.217.11 Web Server : Apache/2.4.58 (Ubuntu) System : Linux conductive 6.8.0-117-generic #117-Ubuntu SMP PREEMPT_DYNAMIC Tue May 5 19:26:24 UTC 2026 x86_64 User : ( 1000) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/go/src/internal/sysinfo/ |
Upload File : |
// Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package sysinfo implements high level hardware information gathering
// that can be used for debugging or information purposes.
package sysinfo
import (
"internal/cpu"
"sync"
)
var cpuInfo struct {
once sync.Once
name string
}
func CPUName() string {
cpuInfo.once.Do(func() {
// Try to get the information from internal/cpu.
if name := cpu.Name(); name != "" {
cpuInfo.name = name
return
}
// TODO(martisch): use /proc/cpuinfo and /sys/devices/system/cpu/ on Linux as fallback.
if name := osCpuInfoName(); name != "" {
cpuInfo.name = name
return
}
})
return cpuInfo.name
}