Using Golang I'm trying to find/write a function that would return the number of CPU Sockets, Cores per socket, and Threads per core a Linux system. For example, a server might have 2 CPUs each with 4 cores, with hyperthreading, it could handle 8 threads per CPU.

Sample Output:

{
  "CPUSockets": "2",
  "CoresPerSocket": "4",
  "ThreadsPerCore": "2"
}

Question: Do you know of any Go Package or pseudo code that could provide this information?

lscpu