all repos — homestead @ d9a119ca0abe7ffedd125c81c78f725aab886d29

Code for my website

re-format go files

Alan Pearce
commit

d9a119ca0abe7ffedd125c81c78f725aab886d29

parent

7a7c44a6caec3fd3b5eb655f332450e86b8c4774

M .golangci.yaml.golangci.yaml
@@ -40,3 +40,14 @@ presets:
- comments - std-error-handling - common-false-positives +formatters: + enable: + - gci + - golines + settings: + gci: + custom-order: true + sections: + - standard + - default + - localmodule
M domain/analytics/goatcounter/count.godomain/analytics/goatcounter/count.go
@@ -8,10 +8,11 @@ "io"
"net/http" "time" - "alin.ovh/homestead/shared/config" "alin.ovh/x/log" "github.com/Southclaws/fault" "github.com/Southclaws/fault/fmsg" + + "alin.ovh/homestead/shared/config" ) type Options struct {
M domain/content/builder/build/main.godomain/content/builder/build/main.go
@@ -5,13 +5,13 @@ "errors"
"fmt" "os" + "alin.ovh/x/log" + "github.com/ardanlabs/conf/v3" + "alin.ovh/homestead/domain/content/builder" "alin.ovh/homestead/shared/config" "alin.ovh/homestead/shared/storage/files" "alin.ovh/homestead/shared/vcs" - "alin.ovh/x/log" - - "github.com/ardanlabs/conf/v3" ) type Options struct {
M domain/content/builder/builder.godomain/content/builder/builder.go
@@ -9,6 +9,11 @@ "path/filepath"
"slices" "time" + "alin.ovh/x/log" + "github.com/Southclaws/fault" + "github.com/Southclaws/fault/fmsg" + mapset "github.com/deckarep/golang-set/v2" + "alin.ovh/homestead/domain/content" "alin.ovh/homestead/domain/content/builder/template" ctemplates "alin.ovh/homestead/domain/content/templates"
@@ -19,11 +24,6 @@ "alin.ovh/homestead/shared/buffer"
"alin.ovh/homestead/shared/config" "alin.ovh/homestead/shared/storage" "alin.ovh/homestead/shared/vcs" - "alin.ovh/x/log" - - "github.com/Southclaws/fault" - "github.com/Southclaws/fault/fmsg" - mapset "github.com/deckarep/golang-set/v2" ) type Options struct {
M domain/content/builder/template/template.godomain/content/builder/template/template.go
@@ -6,16 +6,16 @@ "encoding/xml"
"io" "text/template" - "alin.ovh/homestead/domain/content" - "alin.ovh/homestead/domain/indieweb/atom" - "alin.ovh/homestead/domain/web/templates" - "alin.ovh/homestead/shared/config" - "github.com/PuerkitoBio/goquery" "github.com/Southclaws/fault" "github.com/Southclaws/fault/fmsg" "github.com/antchfx/xmlquery" "github.com/antchfx/xpath" + + "alin.ovh/homestead/domain/content" + "alin.ovh/homestead/domain/indieweb/atom" + "alin.ovh/homestead/domain/web/templates" + "alin.ovh/homestead/shared/config" ) var nsMap = map[string]string{
M domain/content/fetcher/fetcher.godomain/content/fetcher/fetcher.go
@@ -14,12 +14,13 @@ "strconv"
"strings" "time" - "alin.ovh/homestead/shared/config" - "alin.ovh/homestead/shared/events" "alin.ovh/x/log" "github.com/Southclaws/fault" "github.com/Southclaws/fault/fmsg" "github.com/google/renameio/v2" + + "alin.ovh/homestead/shared/config" + "alin.ovh/homestead/shared/events" ) type Fetcher struct {
M domain/content/posts.godomain/content/posts.go
@@ -12,14 +12,14 @@ "slices"
"strings" "time" - "alin.ovh/homestead/domain/content/markdown" - "alin.ovh/homestead/shared/vcs" "alin.ovh/x/log" - "github.com/Southclaws/fault" "github.com/Southclaws/fault/fmsg" "github.com/adrg/frontmatter" mapset "github.com/deckarep/golang-set/v2" + + "alin.ovh/homestead/domain/content/markdown" + "alin.ovh/homestead/shared/vcs" ) type PostMatter struct {
M domain/content/publisher/app.godomain/content/publisher/app.go
@@ -3,6 +3,7 @@
import ( "net/http" + "alin.ovh/x/log" "github.com/Southclaws/fault" "github.com/Southclaws/fault/fmsg" "go.hacdias.com/indielib/indieauth"
@@ -12,7 +13,6 @@ "alin.ovh/homestead/domain/web/server"
"alin.ovh/homestead/domain/web/templates" "alin.ovh/homestead/shared/config" ihttp "alin.ovh/homestead/shared/http" - "alin.ovh/x/log" ) type Options struct {
M domain/content/publisher/barkeep/main.godomain/content/publisher/barkeep/main.go
@@ -7,13 +7,13 @@ "fmt"
"os" "path/filepath" + "alin.ovh/x/log" "github.com/ardanlabs/conf/v3" "tailscale.com/tsnet" "alin.ovh/homestead/domain/content/publisher" "alin.ovh/homestead/domain/web/server" "alin.ovh/homestead/shared/env" - "alin.ovh/x/log" ) type Options struct {
M domain/content/publisher/mux.godomain/content/publisher/mux.go
@@ -4,10 +4,11 @@ import (
"context" "net/http" + "tailscale.com/tailcfg" + "alin.ovh/homestead/domain/content/publisher/templates" basetpl "alin.ovh/homestead/domain/web/templates" ihttp "alin.ovh/homestead/shared/http" - "tailscale.com/tailcfg" ) type user struct{}
M domain/content/publisher/templates/index.godomain/content/publisher/templates/index.go
@@ -3,6 +3,7 @@
import ( g "alin.ovh/gomponents" . "alin.ovh/gomponents/html" + base "alin.ovh/homestead/domain/web/templates" )
M domain/content/publisher/templates/layout.godomain/content/publisher/templates/layout.go
@@ -1,11 +1,11 @@
package templates import ( - base "alin.ovh/homestead/domain/web/templates" - g "alin.ovh/gomponents" c "alin.ovh/gomponents/components" . "alin.ovh/gomponents/html" + + base "alin.ovh/homestead/domain/web/templates" ) func Layout(site base.SiteSettings, page base.PageSettings, children ...g.Node) g.Node {
M domain/content/templates/homepage.godomain/content/templates/homepage.go
@@ -1,12 +1,12 @@
package templates import ( + g "alin.ovh/gomponents" + . "alin.ovh/gomponents/html" + "alin.ovh/homestead/domain/content" "alin.ovh/homestead/domain/web/templates" "alin.ovh/homestead/shared/config" - - g "alin.ovh/gomponents" - . "alin.ovh/gomponents/html" ) type HomepageVars struct {
M domain/content/templates/list.godomain/content/templates/list.go
@@ -1,11 +1,11 @@
package templates import ( - "alin.ovh/homestead/domain/content" - "alin.ovh/homestead/domain/web/templates" - g "alin.ovh/gomponents" . "alin.ovh/gomponents/html" + + "alin.ovh/homestead/domain/content" + "alin.ovh/homestead/domain/web/templates" ) type TagPageVars struct {
M domain/content/templates/page.godomain/content/templates/page.go
@@ -1,11 +1,11 @@
package templates import ( - "alin.ovh/homestead/domain/content" - "alin.ovh/homestead/domain/web/templates" - g "alin.ovh/gomponents" . "alin.ovh/gomponents/html" + + "alin.ovh/homestead/domain/content" + "alin.ovh/homestead/domain/web/templates" ) func Page(site templates.SiteSettings, page *content.Post) g.Node {
M domain/content/templates/post.godomain/content/templates/post.go
@@ -3,12 +3,12 @@
import ( "time" + g "alin.ovh/gomponents" + . "alin.ovh/gomponents/html" + "alin.ovh/homestead/domain/content" "alin.ovh/homestead/domain/web/templates" "alin.ovh/homestead/shared/vcs" - - g "alin.ovh/gomponents" - . "alin.ovh/gomponents/html" ) func PostPage(site templates.SiteSettings, post *content.Post) g.Node {
M domain/identity/oidc/service.godomain/identity/oidc/service.go
@@ -3,11 +3,11 @@
import ( "net/http" - "alin.ovh/homestead/shared/config" - sharedhttp "alin.ovh/homestead/shared/http" "alin.ovh/x/log" - "github.com/benpate/digit" + + "alin.ovh/homestead/shared/config" + sharedhttp "alin.ovh/homestead/shared/http" ) type Service struct {
M domain/identity/service.godomain/identity/service.go
@@ -1,11 +1,12 @@
package identity import ( + "alin.ovh/x/log" + "alin.ovh/homestead/domain/identity/oidc" "alin.ovh/homestead/domain/identity/webfinger" "alin.ovh/homestead/shared/config" "alin.ovh/homestead/shared/http" - "alin.ovh/x/log" ) type Service struct {
M domain/identity/webfinger/service.godomain/identity/webfinger/service.go
@@ -4,10 +4,10 @@ import (
"encoding/json" "net/http" - ihttp "alin.ovh/homestead/shared/http" "alin.ovh/x/log" - "github.com/benpate/digit" + + ihttp "alin.ovh/homestead/shared/http" ) type ResourceProvider interface {
M domain/indieweb/atom/atom.godomain/indieweb/atom/atom.go
@@ -6,8 +6,9 @@ "encoding/xml"
"net/url" "time" + "github.com/Southclaws/fault" + "alin.ovh/homestead/shared/config" - "github.com/Southclaws/fault" ) type Link struct {
M domain/indieweb/sitemap/sitemap.godomain/indieweb/sitemap/sitemap.go
@@ -4,9 +4,9 @@ import (
"io" "time" - "alin.ovh/homestead/shared/config" - "github.com/snabb/sitemap" + + "alin.ovh/homestead/shared/config" ) type Sitemap struct {
M domain/vanity/templates/gopkg.godomain/vanity/templates/gopkg.go
@@ -6,6 +6,7 @@ "net/url"
g "alin.ovh/gomponents" . "alin.ovh/gomponents/html" + "alin.ovh/homestead/domain/web/templates" "alin.ovh/homestead/shared/config" )
M domain/web/mux.godomain/web/mux.go
@@ -6,13 +6,13 @@ "regexp"
"slices" "strings" + "github.com/kevinpollet/nego" + "alin.ovh/homestead/domain/analytics" calendar "alin.ovh/homestead/domain/calendar/templates" "alin.ovh/homestead/domain/web/server" "alin.ovh/homestead/domain/web/templates" ihttp "alin.ovh/homestead/shared/http" - - "github.com/kevinpollet/nego" ) var (
M domain/web/server/logging.godomain/web/server/logging.go
@@ -3,9 +3,9 @@
import ( "net/http" - sharedhttp "alin.ovh/homestead/shared/http" - "alin.ovh/x/log" + + sharedhttp "alin.ovh/homestead/shared/http" ) func wrapHandlerWithLogging(wrappedHandler http.Handler, log *log.Logger) http.Handler {
M domain/web/server/server.godomain/web/server/server.go
@@ -9,10 +9,9 @@ "net/http"
"time" "alin.ovh/x/log" - "github.com/osdevisnot/sorvor/pkg/livereload" - "github.com/Southclaws/fault" "github.com/Southclaws/fault/fmsg" + "github.com/osdevisnot/sorvor/pkg/livereload" ) type Options struct {
M domain/web/templates/error.godomain/web/templates/error.go
@@ -3,6 +3,7 @@
import ( g "alin.ovh/gomponents" . "alin.ovh/gomponents/html" + "alin.ovh/homestead/shared/http" )
M domain/web/templates/layout.godomain/web/templates/layout.go
@@ -3,12 +3,12 @@
import ( "io" - "alin.ovh/homestead/shared/config" + g "alin.ovh/gomponents" + . "alin.ovh/gomponents/html" "github.com/Southclaws/fault" "github.com/alanpearce/htmlformat" - g "alin.ovh/gomponents" - . "alin.ovh/gomponents/html" + "alin.ovh/homestead/shared/config" ) type SiteSettings struct {
M domain/web/website.godomain/web/website.go
@@ -7,6 +7,11 @@ "os"
"sync" "time" + "alin.ovh/x/log" + "github.com/Southclaws/fault" + "github.com/Southclaws/fault/fmsg" + "github.com/osdevisnot/sorvor/pkg/livereload" + "alin.ovh/homestead/domain/analytics" "alin.ovh/homestead/domain/analytics/goatcounter" "alin.ovh/homestead/domain/analytics/nullcounter"
@@ -21,11 +26,6 @@ "alin.ovh/homestead/shared/file"
ihttp "alin.ovh/homestead/shared/http" "alin.ovh/homestead/shared/storage" "alin.ovh/homestead/shared/storage/files" - "alin.ovh/x/log" - "github.com/Southclaws/fault" - "github.com/Southclaws/fault/fmsg" - - "github.com/osdevisnot/sorvor/pkg/livereload" ) type Options struct {
M main.gomain.go
@@ -8,12 +8,12 @@ "os"
"os/signal" "time" - website "alin.ovh/homestead/domain/web" - "alin.ovh/homestead/domain/web/server" "alin.ovh/x/log" - "github.com/ardanlabs/conf/v3" "github.com/osdevisnot/sorvor/pkg/livereload" + + website "alin.ovh/homestead/domain/web" + "alin.ovh/homestead/domain/web/server" ) type Options struct {
M shared/config/config.goshared/config/config.go
@@ -8,7 +8,6 @@ "path/filepath"
"time" "alin.ovh/x/log" - "github.com/BurntSushi/toml" "github.com/Southclaws/fault" "github.com/Southclaws/fault/fmsg"
M shared/events/file.goshared/events/file.go
@@ -11,7 +11,6 @@ "slices"
"time" "alin.ovh/x/log" - "github.com/Southclaws/fault" "github.com/Southclaws/fault/fmsg" "github.com/fsnotify/fsnotify"
M shared/storage/file.goshared/storage/file.go
@@ -5,10 +5,11 @@ "io"
"strings" "time" + "github.com/Southclaws/fault" + "github.com/Southclaws/fault/fmsg" + "alin.ovh/homestead/domain/content/builder/template" "alin.ovh/homestead/shared/buffer" - "github.com/Southclaws/fault" - "github.com/Southclaws/fault/fmsg" ) type File struct {
M shared/storage/files/file.goshared/storage/files/file.go
@@ -11,10 +11,11 @@ "os"
"path/filepath" "strings" + "github.com/Southclaws/fault" + "github.com/Southclaws/fault/fmsg" + "alin.ovh/homestead/shared/buffer" "alin.ovh/homestead/shared/storage" - "github.com/Southclaws/fault" - "github.com/Southclaws/fault/fmsg" ) var encodings = map[string]string{
M shared/storage/files/reader.goshared/storage/files/reader.go
@@ -6,11 +6,11 @@ "io/fs"
"path/filepath" "strings" - "alin.ovh/homestead/shared/storage" "alin.ovh/x/log" - "github.com/Southclaws/fault" "github.com/Southclaws/fault/fmsg" + + "alin.ovh/homestead/shared/storage" ) type Reader struct {
M shared/storage/files/writer.goshared/storage/files/writer.go
@@ -6,16 +6,16 @@ "io"
"os" "path/filepath" - "alin.ovh/homestead/domain/content" - "alin.ovh/homestead/shared/buffer" - "alin.ovh/homestead/shared/file" - "alin.ovh/homestead/shared/storage" "alin.ovh/x/log" - "github.com/Southclaws/fault" "github.com/Southclaws/fault/fmsg" "github.com/andybalholm/brotli" "github.com/klauspost/compress/zstd" + + "alin.ovh/homestead/domain/content" + "alin.ovh/homestead/shared/buffer" + "alin.ovh/homestead/shared/file" + "alin.ovh/homestead/shared/storage" ) type Files struct {
M shared/vcs/repository.goshared/vcs/repository.go
@@ -4,13 +4,13 @@ import (
"errors" "os" - "alin.ovh/homestead/shared/config" - "alin.ovh/homestead/shared/file" "alin.ovh/x/log" - "github.com/Southclaws/fault" "github.com/go-git/go-git/v5" "github.com/go-git/go-git/v5/plumbing" + + "alin.ovh/homestead/shared/config" + "alin.ovh/homestead/shared/file" ) type Options struct {