code: func (s *systemInfo) collectPlatformInfo() error {
  	var err error
  	if s.platform == "" {
  		s.platform, s.family, s.osVersion, err = host.PlatformInformation()
  		if err != nil {
  			return err
  		}
  	}
  	if s.cpuModel == "" {
  		infos, err := cpu.Info()
  		if err != nil || len(infos) == 0 {
  			s.cpuModel = "unknown"
  			// if err is nil, but we got no infos, we don't
  			// have a meaningful error to return.
  			return err
  		}
  		s.cpuModel = infos[0].ModelName
  		s.cpuMHz = computeMHz(s.cpuModel)
  
  		// gopsutil reports core and clock speed info inconsistently
  		// by OS
  		switch runtime.GOOS {
  		case "linux":
  			// Each reported "CPU" is a logical core. Some cores may
  			// have the same Core ID, which is a strictly numeric
  			// value which gopsutil returned as a string, which
  			// indicates that they're hyperthreading or similar things
  			// on the same physical core.
  			uniqueCores := make(map[string]struct{}, len(infos))
  			totalCores := 0
  			for _, info := range infos {
  				uniqueCores[info.CoreID] = struct{}{}
  				totalCores += int(info.Cores)
  			}
  			s.cpuPhysicalCores = len(uniqueCores)
  			s.cpuLogicalCores = totalCores
  		case "darwin":
  			fallthrough
  		default: // let's hope other systems give useful core info?
  			s.cpuPhysicalCores = int(infos[0].Cores)
  			// we have no way to know, let's try runtime
  			s.cpuLogicalCores = runtime.NumCPU()
  		}
  		return nil
  	}
  	return nil
  }
docs: // collectPlatformInfo fetches and caches system platform information.