Skip to content

Commit

Permalink
gofmt 1.19 on all files
Browse files Browse the repository at this point in the history
  • Loading branch information
arp242 committed Oct 26, 2022
1 parent f1fae72 commit 01c84c3
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 19 deletions.
16 changes: 8 additions & 8 deletions bgrun/bgrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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() {
Expand Down
3 changes: 2 additions & 1 deletion gctest/gctest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down
6 changes: 3 additions & 3 deletions handlers/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
1 change: 1 addition & 0 deletions i18n.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
)

// Translations contains all translation messages.
//
//go:embed i18n/*
var translations embed.FS

Expand Down
12 changes: 6 additions & 6 deletions metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 01c84c3

Please sign in to comment.