NormalizeScheme (forge/remote.go)

clawbench · internal/forge/remote.go · go · MIT
integration, Integration / API

Go library that parses and normalizes Git forge URLs for GitHub/GitLab.

// Source: https://github.com/clawbench-dev/clawbench | License: MIT | Copyright 2025 xulongzhe
// Provided via justclaw.it.com; keep this notice with the code.
// Package forge provides a unified, read-only abstraction over source-code
// hosting platforms (GitHub, GitLab) for browsing issues and PR/MR content.
package forge

import (
	"errors"
	"fmt"
	"net/url"
	"strings"
)

// Platform identifies a supported forge platform.
type Platform string

const (
	PlatformGitHub Platform = "github"
	PlatformGitLab Platform = "gitlab"
)

// Official hosts for each platform.
const (
	GitHubHost = "github.com"
	GitLabHost = "gitlab.com"
)

// API schemes. Self-hosted instances are commonly served over plain http on an
// internal network, so http is a first-class choice rather than an error.
const (

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key