Compare commits

...

3 commits
v0.1.0 ... main

Author SHA1 Message Date
c9bed954a4 Update path 2025-06-01 09:22:00 +01:00
01573ad190 Use the Repl type in Reverse 2025-01-28 21:12:23 +00:00
b7a3e1c013 Add Repl type
Adds as alias for map[string]string
2025-01-28 21:10:35 +00:00
2 changed files with 4 additions and 2 deletions

View file

@ -26,8 +26,10 @@ type URLs struct {
Prefix string
}
type Repl map[string]string
// Given a name and replacements, return a rendered path component of a URL
func (urls URLs) Reverse(name string, replacements map[string]string) string {
func (urls URLs) Reverse(name string, replacements Repl) string {
pattern := urls.URLs[name].Path
for key, val := range replacements {

2
go.mod
View file

@ -1,3 +1,3 @@
module gitea.gwairfelin.com/max/gispatcho
module forgejo.gwairfelin.com/max/gispatcho
go 1.23.5