go-forge/helpers.go
Virgil 551a964fdb
All checks were successful
Security Scan / security (push) Successful in 9s
Test / test (push) Successful in 1m36s
refactor(ax): enforce v0.8.0 polish rules
Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-29 23:39:24 +00:00

35 lines
562 B
Go

package forge
import (
"strconv"
core "dappco.re/go/core"
)
func trimTrailingSlashes(s string) string {
for core.HasSuffix(s, "/") {
s = core.TrimSuffix(s, "/")
}
return s
}
func int64String(v int64) string {
return strconv.FormatInt(v, 10)
}
func pathParams(values ...string) Params {
params := make(Params, len(values)/2)
for i := 0; i+1 < len(values); i += 2 {
params[values[i]] = values[i+1]
}
return params
}
func lastIndexByte(s string, b byte) int {
for i := len(s) - 1; i >= 0; i-- {
if s[i] == b {
return i
}
}
return -1
}