diff --git a/backend/library/library.go b/backend/library/library.go index b464c00..92855a5 100644 --- a/backend/library/library.go +++ b/backend/library/library.go @@ -32,6 +32,8 @@ type Library struct { } // NewLibrary creates a new library with the given configuration. +// A nil config is permitted; the library will be inert until a valid +// configuration is supplied via the LibraryConfigChanged event. func NewLibrary( ctx context.Context, logger *slog.Logger, @@ -39,7 +41,7 @@ func NewLibrary( db *database.DB, ) (*Library, error) { if conf == nil { - return nil, errors.New("nil config for library") + conf = &Config{} } if err := conf.Validate(); err != nil { diff --git a/lefthook.yml b/lefthook.yml index 765f52b..94ec238 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -11,7 +11,7 @@ pre-commit: golangci-lint: glob: "*.go" - run: golangci-lint run --timeout 5m -tags webkit2_41 {staged_files} + run: golangci-lint run --timeout 5m --build-tags webkit2_41 ./... codegen-check: glob: "*.{go,sql,templ}"