Skip to content

Commit

Permalink
$ gofmt changes in updated Go version
Browse files Browse the repository at this point in the history
  • Loading branch information
joonas-fi committed Apr 10, 2023
1 parent 368fa25 commit 91f1c5c
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
3 changes: 2 additions & 1 deletion pkg/blorm/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// this was born because: https://github.com/asdine/storm/issues/222#issuecomment-472791001
//
// Warning: don't Each() and Delete() at the same time. Deletion messes with the iteration
// order somehow, and I observed half of the records was deleted when I tried to delete all.
//
// order somehow, and I observed half of the records was deleted when I tried to delete all.
package blorm

import (
Expand Down
3 changes: 2 additions & 1 deletion pkg/mutexmap/mutexmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ import (
// When you TryLock():
// a) it won't open if it's already occupied. (because it's locked inside) decide to do something else
// b) it opens and you get in and the stall gets reserved/locked for you. When you get out
// you call the unlock callback you obtained from TryLock() to return the stall for use.
//
// you call the unlock callback you obtained from TryLock() to return the stall for use.
type M struct {
// value is chan that Lock() can use to listen for unlock event (close of channel)
locks map[string]chan bool
Expand Down
7 changes: 4 additions & 3 deletions pkg/smart/smart.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@ func SmartCtlBackend(device string) ([]byte, error) {
return stdout, silenceSmartCtlAutomationHostileErrors(err)
}

/* joonas/smartmontools built from simple Dockerfile:
/*
joonas/smartmontools built from simple Dockerfile:
FROM alpine:edge
RUN apk add --update smartmontools
FROM alpine:edge
RUN apk add --update smartmontools
*/
func SmartCtlViaDockerBackend(device string) ([]byte, error) {
// disks in /dev are visible without --privileged (by mapping /dev:/dev) but
Expand Down
7 changes: 4 additions & 3 deletions pkg/stofuse/collectionadapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,11 @@ func (a *changedFileInWorkdir) Open(ctx context.Context, req *fuse.OpenRequest,
return &changedFileInWorkdirHandle{hdl}, nil
}

/* To test
/*
To test
$ apt install -y attr
$ setfattr -n user.foo -v hihi foobar.txt
$ apt install -y attr
$ setfattr -n user.foo -v hihi foobar.txt
*/
func (a *changedFileInWorkdir) Listxattr(ctx context.Context, req *fuse.ListxattrRequest, resp *fuse.ListxattrResponse) error {
log.Printf("Listxattr %s", a.backingFilePath)
Expand Down
8 changes: 4 additions & 4 deletions pkg/stoserver/health.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ func healthForScheduledJobs(tx *bbolt.Tx) stohealth.HealthChecker {
}

/*
<=5 freezing (fail)
5-45 => ok (pass)
45-50 => uncomfortable (warn)
>=50 => too hot (fail)
<=5 freezing (fail)
5-45 => ok (pass)
45-50 => uncomfortable (warn)
>=50 => too hot (fail)
*/
func temperatureToHealthStatus(tempC int) stoservertypes.HealthStatus {
switch {
Expand Down
3 changes: 2 additions & 1 deletion pkg/stoserver/restapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,8 @@ func (h *handlers) DatabaseExportSha256s(rctx *httpauth.RequestContext, w http.R
// robustness of the metadata database. that's why we have this export endpoint - to get
// backups. more confidence will come when this whole system is hooked up to Event Horizon.
// Run this with:
// $ curl -H "Authorization: Bearer $BUP_AUTHTOKEN" https://localhost/api/db/export
//
// $ curl -H "Authorization: Bearer $BUP_AUTHTOKEN" https://localhost/api/db/export
func (h *handlers) DatabaseExport(rctx *httpauth.RequestContext, w http.ResponseWriter, r *http.Request) {
tx, err := h.db.Begin(false)
panicIfError(err)
Expand Down

0 comments on commit 91f1c5c

Please sign in to comment.