enable formatting via golangci-lint
9 files changed, 24 insertions(+), 10 deletions(-)
M .golangci.yaml → .golangci.yaml
@@ -57,6 +57,18 @@ - third_party$ - builtin$ - examples$ formatters: + enable: + - gofumpt + - golines + - goimports + settings: + gofmt: + simplify: true + golines: + tab-len: 2 + goimports: + local-prefixes: + - alin.ovh/searchix exclusions: generated: lax paths:
M git/git.go → git/git.go
@@ -352,7 +352,6 @@ } _, err = io.Copy(tw, reader) err = errors.Join(err, reader.Close()) - if err != nil { return err }
M routes/handler.go → routes/handler.go
@@ -16,8 +16,10 @@ "alin.ovh/elgit/config" ) -var ErrMethodNotAllowed = fmt.Errorf("that's not possible") -var ErrNotFound = fmt.Errorf("nothing like that here") +var ( + ErrMethodNotAllowed = fmt.Errorf("that's not possible") + ErrNotFound = fmt.Errorf("nothing like that here") +) func Handlers(c *config.Config, staticFiles fs.FS) *atreugo.Atreugo { d := deps{
M routes/routes.go → routes/routes.go
@@ -26,8 +26,6 @@ repos *data.Entries } func (d *deps) Index(rc *atreugo.RequestCtx) error { - - pageData := templates.PageData{ Meta: d.c.Meta, }
M templates/file.go → templates/file.go
@@ -31,7 +31,8 @@ A( ID(fmt.Sprintf("L%d", line)), Href(fmt.Sprintf("#L%d", line)), g.Text(fmt.Sprintf("%d", line)), - )}) + ), + }) })), ), Td(Class("file-content"),
M templates/index.go → templates/index.go
@@ -3,11 +3,11 @@ import ( "time" - "github.com/dustin/go-humanize" "alin.ovh/elgit/data" g "alin.ovh/gomponents" c "alin.ovh/gomponents/components" . "alin.ovh/gomponents/html" + "github.com/dustin/go-humanize" ) func IndexPage(pd PageData, entries *data.Entries) g.Node {
M templates/refs.go → templates/refs.go
@@ -3,10 +3,10 @@ import ( "fmt" - "github.com/go-git/go-git/v5/plumbing" "alin.ovh/elgit/git" g "alin.ovh/gomponents" . "alin.ovh/gomponents/html" + "github.com/go-git/go-git/v5/plumbing" ) // RefsPage renders the repository references page
M templates/tree.go → templates/tree.go
@@ -74,5 +74,6 @@ ), Article( g.If(readme != "", Pre(g.Raw(readme))), ), - )}) + ), + }) }