go-forge/params.go
Claude 1ffb4bee5a
All checks were successful
Security Scan / security (push) Successful in 8s
Test / test (push) Successful in 1m20s
feat: upgrade to core v0.8.0-alpha.1, replace banned stdlib imports
Replace fmt, errors, strings, path/filepath, encoding/json with Core
primitives across 23 files. Keep encoding/json for streaming
NewDecoder/NewEncoder, strings for Fields/FieldsFuncSeq.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 13:27:06 +00:00

19 lines
431 B
Go

package forge
import (
"net/url"
core "dappco.re/go/core"
)
// Params maps path variable names to values.
// Example: Params{"owner": "core", "repo": "go-forge"}
type Params map[string]string
// ResolvePath substitutes {placeholders} in path with values from params.
func ResolvePath(path string, params Params) string {
for k, v := range params {
path = core.Replace(path, "{"+k+"}", url.PathEscape(v))
}
return path
}