INNER CODE UNIT · Go

socketExists

Netis/cloud-probe · cptools/cripid/main.go:69

func socketExists(endpoint string) (bool, error) {
	path, ok := strings.CutPrefix(endpoint, "unix://")
	if !ok {
		return true, nil
	}
	if _, err := os.Stat(path); err != nil {
		if errors.Is(err, os.ErrNotExist) {
			return false, nil
		}
		return false, fmt.Errorf("stat %s: %w", path, err)
	}
	return true, nil
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…