all repos — website @ 51a9cf280ff4045b360519ef8cc1ee4203a2c7bc

My website

fix linter complaints
Alan Pearce alan@alanpearce.eu
Fri, 24 Jan 2025 22:15:46 +0100
commit

51a9cf280ff4045b360519ef8cc1ee4203a2c7bc

parent

177955eab572c13b7d99217e54250f377c9a3c9e

2 files changed, 8 insertions(+), 2 deletions(-)

jump to
M internal/server/server.gointernal/server/server.go
@@ -190,7 +190,7 @@ ) 		replace := "${1}." + config.Domains[0]
 		loggingMux.Handle(config.BaseURL.Hostname()+"/", mux)
 		loggingMux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
-			switch true {
+			switch {
 			case slices.Contains(config.Domains, r.Host):
 				path, _ := website.CanonicalisePath(r.URL.Path)
 				http.Redirect(
M internal/vcs/repository.gointernal/vcs/repository.go
@@ -82,6 +82,9 @@ } 	refs, err := rem.List(&git.ListOptions{
 		Timeout: 5,
 	})
+	if err != nil {
+		return false, err
+	}
 
 	var hash plumbing.Hash
 	for _, ref := range refs {
@@ -94,10 +97,13 @@ wt, err := r.repo.Worktree() 	if err != nil {
 		return false, err
 	}
-	wt.Checkout(&git.CheckoutOptions{
+	err = wt.Checkout(&git.CheckoutOptions{
 		Hash:  hash,
 		Force: true,
 	})
+	if err != nil {
+		return false, err
+	}
 
 	r.log.Info("updated to", "rev", hash)