summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Paul <n@nc0.fr>2023-05-31 13:22:18 +0200
committerNicolas Paul <n@nc0.fr>2023-05-31 13:22:18 +0200
commitde2a79eed5de749470d2d66263f7f9836706f4ec (patch)
tree0ddb134c3b774d9eb505aa461407c0f952c7afcb
parent72da83a0469c719f03682d1f1fe01c9b73f0ac5b (diff)
Remove useless lock
Signed-off-by: Nicolas Paul <n@nc0.fr>
-rw-r--r--pkg/types/module.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/pkg/types/module.go b/pkg/types/module.go
index 6cee7b1..7a09f8b 100644
--- a/pkg/types/module.go
+++ b/pkg/types/module.go
@@ -1,10 +1,10 @@
package types
import (
+ "fmt"
"go.nc0.fr/svgu/pkg/templates"
"os"
"path"
- "sync"
)
// Vcs is an enum for version control systems supported by the standard Go
@@ -29,14 +29,10 @@ type Module struct {
Repo string // repository's home
Dir string // url template
File string // url template
- // internal
- lock sync.Mutex
}
// GenerateFile generates the index file.
func (m *Module) GenerateFile(out string, domain string) error {
- m.lock.Lock()
- defer m.lock.Unlock()
f := path.Join(out, m.Path+".html")
@@ -53,7 +49,8 @@ func (m *Module) GenerateFile(out string, domain string) error {
}(fd)
// Execute the template and write the output to the file.
- if err := templates.ExecModule(fd, domain+m.Path, string(m.Vcs),
+ if err := templates.ExecModule(fd,
+ fmt.Sprintf("%s/%s", domain, m.Path), string(m.Vcs),
m.Repo, m.Dir, m.File); err != nil {
return err
}