badge-generator
badge-generator copied to clipboard
Add Go URL to dependency badge
e.g.
https://pkg.go.dev/github.com/shurcooL/githubv4 https://pkg.go.dev/google.golang.org/api/transport/http https://pkg.go.dev/net/http/httputil https://pkg.go.dev/golang.org/x/oauth2
New logic is needed to use the last part for the dependency name, or the last two parts, but exclude GitHub, even though it won't always be there
Sample
it("returns a static badge for a Go package", () => {
const imageTarget = "https://img.shields.io/badge/dependency-githubv4-blue";
const linkTarget = "https://pkg.go.dev/github.com/shurcooL/githubv4";
expect(dependency("githubv4", REGISTRY.Go, {})).toBe(
`[](${linkTarget})`
);
});
This will be an extra option on the Packages screen and can use dependency function. Or a new function to keep that one light.