diff options
| author | Fuwn <[email protected]> | 2026-02-26 16:26:38 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-26 16:26:38 -0800 |
| commit | 8b7f7b938aead6ec285c5c9290f9a4305b96521f (patch) | |
| tree | 3a52bd80d3a0468b3fc96c5b240d02d7b16e8f49 /internal/storage/pebble_store.go | |
| parent | feat: Apply Iku formatting (diff) | |
| download | plutia-test-8b7f7b938aead6ec285c5c9290f9a4305b96521f.tar.xz plutia-test-8b7f7b938aead6ec285c5c9290f9a4305b96521f.zip | |
style: align codebase with official Go idioms
Diffstat (limited to 'internal/storage/pebble_store.go')
| -rw-r--r-- | internal/storage/pebble_store.go | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/internal/storage/pebble_store.go b/internal/storage/pebble_store.go index 55c04fb..b0a8e01 100644 --- a/internal/storage/pebble_store.go +++ b/internal/storage/pebble_store.go @@ -4,10 +4,10 @@ import ( "encoding/binary" "encoding/json" "fmt" - "path/filepath" - "sort" "github.com/Fuwn/plutia/internal/types" "github.com/cockroachdb/pebble" + "path/filepath" + "sort" ) var _ Store = (*PebbleStore)(nil) @@ -30,9 +30,9 @@ func OpenPebble(dataDir string) (*PebbleStore, error) { func (p *PebbleStore) Close() error { return p.db.Close() } func (p *PebbleStore) GetMode() (string, error) { - v, ok, err := p.getString(metaKey("mode")) + v, _, err := p.getString(metaKey("mode")) - return v, okOrErr(ok, err) + return v, err } func (p *PebbleStore) SetMode(mode string) error { @@ -462,11 +462,11 @@ func (p *PebbleStore) getUint64(key []byte) (uint64, bool, error) { return binary.BigEndian.Uint64(b), true, nil } -func didKey(did string) []byte { return []byte("did:" + did) } +func didKey(did string) []byte { return []byte("did:" + did) } func chainKey(did string) []byte { return []byte("chain:" + did) } -func metaKey(k string) []byte { return []byte("meta:" + k) } +func metaKey(k string) []byte { return []byte("meta:" + k) } func checkpointKey(s uint64) []byte { return append([]byte("checkpoint:"), u64bytes(s)...) @@ -491,15 +491,3 @@ func u64bytes(v uint64) []byte { return b } - -func okOrErr(ok bool, err error) error { - if err != nil { - return err - } - - if !ok { - return nil - } - - return nil -} |