func processNameMatches(pid int, expectedPrefix string) (bool, error) {
	process, err := ps.FindProcess(pid)
	if err != nil {
		return false, fmt.Errorf("find process: %d: %w", pid, err)
	}
	if process == nil {
		return false, nil
	}
	return strings.HasPrefix(strings.ToLower(process.Executable()), strings.ToLower(expectedPrefix)), nil
}
// processNameMatches returns whether the process running with the given pid matches
// the executable name (case insensitive).
//
// If there's no process running with the given pid then (false, nil) is returned.
processNameMatches returns whether the process running with the given pid matches
the executable name (case insensitive).

If there's no process running with the given pid then (false, nil) is returned.
// processNameMatches returns whether the process running with the given pid matches // the executable name ( case insensitive ) . // // If there ' s no process running with the given pid then ( false nil ) is returned .
func processNameMatches(pid int, expectedPrefix string) (bool, error) {
	process, err := ps.FindProcess(pid)
	if err != nil {
		return false, fmt.Errorf("find process: %d: %w", pid, err)
	}
	if process == nil {
		return false, nil
	}
	return strings.HasPrefix(strings.ToLower(process.Executable()), strings.ToLower(expectedPrefix)), nil
}
func processNameMatches ( pid int , expectedPrefix string ) ( bool , error ) { process , err := ps . FindProcess ( pid ) if err != nil { return false , fmt . Errorf ( " " , pid , err ) } if process == nil { return false , nil } return strings . HasPrefix ( strings . ToLower ( process . Executable ( ) ) , strings . ToLower ( expectedPrefix ) ) , nil }
processNameMatches returns whether the process running with the given pid matches
the executable name (case insensitive).
processNameMatches returns whether the process running with the given pid matches the executable name ( case insensitive ) .