diff --git a/bgrun/bgrun.go b/bgrun/bgrun.go index 8913cad5a..73bf2d380 100644 --- a/bgrun/bgrun.go +++ b/bgrun/bgrun.go @@ -138,9 +138,9 @@ func WaitProgressAndLog(ctx context.Context) { // Run the function in a goroutine. // -// bgrun.Run(func() { -// // Do work... -// }) +// bgrun.Run(func() { +// // Do work... +// }) func Run(name string, f func()) { done := add(name, false) go func() { @@ -168,11 +168,11 @@ func RunNoDuplicates(name string, f func()) { // Add a new function to the waitgroup and return the done. // -// done := bgrun.Add() -// go func() { -// defer done() -// defer zlog.Recover() -// }() +// done := bgrun.Add() +// go func() { +// defer done() +// defer zlog.Recover() +// }() func add(name string, nodup bool) func() { wg.Add(1) func() { diff --git a/gctest/gctest.go b/gctest/gctest.go index 0c426df48..4482270c0 100644 --- a/gctest/gctest.go +++ b/gctest/gctest.go @@ -64,7 +64,8 @@ func DBFile(t testing.TB) context.Context { // TODO: this should use zdb.StartTest(); need to be able to pass in some // zdb.ConnectOptions{} to that though. // TODO: we can create unlogged tables in PostgreSQL, which should be faster: -// create unlogged table foo [..] +// +// create unlogged table foo [..] func db(t testing.TB, storeFile bool) context.Context { t.Helper() diff --git a/handlers/loader.go b/handlers/loader.go index 30178345f..d468a0828 100644 --- a/handlers/loader.go +++ b/handlers/loader.go @@ -21,16 +21,16 @@ import ( // On dashboard view we generate a unique ID we send to the frontend, and // register a new loader: // -// loader.register(someUnqiueID) +// loader.register(someUnqiueID) // // The frontend initiatsed a WS connection, and we create a new connection here // too: // -// loader.connect(someUniqueID) +// loader.connect(someUniqueID) // // When we want to send a message: // -// loader.send(someUniqueID, msg) +// loader.send(someUniqueID, msg) // // Because we want to start rendering the charts *before* we send out any data, // we can't use just the connection itself as an ID. We also can't use the diff --git a/helper.go b/helper.go index f3734988f..b0cbdd7a6 100644 --- a/helper.go +++ b/helper.go @@ -23,6 +23,7 @@ import ( ) // DB contains all files in db/* +// //go:embed db/schema.gotxt //go:embed db/languages.sql //go:embed db/migrate/*.sql @@ -31,10 +32,12 @@ import ( var DB embed.FS // Static contains all the static files to serve. +// //go:embed public/* var Static embed.FS // Templates contains all templates. +// //go:embed tpl/* var Templates embed.FS diff --git a/i18n.go b/i18n.go index b0734db74..a7807f5ad 100644 --- a/i18n.go +++ b/i18n.go @@ -23,6 +23,7 @@ import ( ) // Translations contains all translation messages. +// //go:embed i18n/* var translations embed.FS diff --git a/metrics/metrics.go b/metrics/metrics.go index e69f067f3..d41e2c35c 100644 --- a/metrics/metrics.go +++ b/metrics/metrics.go @@ -86,13 +86,13 @@ func (t *Metric) Done() { // AddTag adds another part to this metric's tag, for example: // -// m := Start("hello") -// defer m.Done() +// m := Start("hello") +// defer m.Done() // -// if isCached { -// m.AddTag("cached") -// return cachedItem -// } +// if isCached { +// m.AddTag("cached") +// return cachedItem +// } // // This will record the cached entries as "hello.cached", separate from the // regular "hello" entries. diff --git a/ref.go b/ref.go index 4720f99ed..688492ec1 100644 --- a/ref.go +++ b/ref.go @@ -192,7 +192,7 @@ func cleanRefURL(ref string, refURL *url.URL) (string, bool) { // ListRefsByPath lists all references for a path. // // TODO: refactor frontend so we don't need this any more; we have the path_id -// now and can use the simpler and faster ListRefsByPathID(). +// now and can use the simpler and faster ListRefsByPathID(). func (h *HitStats) ListRefsByPath(ctx context.Context, path string, rng ztime.Range, limit, offset int) error { err := zdb.Select(ctx, &h.Stats, "load:ref.ListRefsByPath.sql", zdb.P{ "site": MustGetSite(ctx).ID,