INNER CODE UNIT · Go

hubRepo

platform-engineering-labs/formae · cmd/bundle-examples/main.go:216

func hubRepo(hub, member string) (string, error) {
	body, err := fetchBytes(fmt.Sprintf("%s/api/v1/plugins/%s", hub, member))
	if err != nil {
		return "", err
	}
	var v struct {
		GithubRepoURL string `json:"github_repo_url"`
	}
	if err := json.Unmarshal(body, &v); err != nil {
		return "", err
	}
	if _, err := validateGH(v.GithubRepoURL); err != nil {
		return "", fmt.Errorf("hub returned %w", err)
	}
	return v.GithubRepoURL, nil
}

// latestTag returns the highest stable X.Y.Z tag on a remote and the commit SHA

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…