lockbox

password manager
Log | Files | Refs | README | LICENSE

commit 72cc17a4f360a8ad414ba697c4c63f1977120b2d
parent d316add2b6b25b0bdb39d10d5357bdfdda4586af
Author: Sean Enck <sean@ttypty.com>
Date:   Mon, 31 Mar 2025 19:43:17 -0400

fieldalignment

Diffstat:
Mgo.mod | 5+++--
Mgo.sum | 8++++----
Minternal/app/commands/core.go | 2+-
Minternal/app/core.go | 2+-
Minternal/app/move_test.go | 6+++---
Minternal/app/rekey_test.go | 4++--
Minternal/app/totp.go | 4++--
Minternal/app/totp_test.go | 2+-
Minternal/backend/core.go | 2+-
Minternal/backend/hooks.go | 2+-
Minternal/backend/query.go | 2+-
Minternal/config/env.go | 8++++----
Minternal/config/key.go | 2+-
Minternal/config/store/core.go | 2+-
Mjustfile | 1+
15 files changed, 27 insertions(+), 25 deletions(-)

diff --git a/go.mod b/go.mod @@ -30,10 +30,10 @@ require ( github.com/tobischo/argon2 v0.1.0 // indirect golang.org/x/crypto v0.36.0 // indirect golang.org/x/exp/typeparams v0.0.0-20241210194714-1829a127f884 // indirect - golang.org/x/mod v0.23.0 // indirect + golang.org/x/mod v0.24.0 // indirect golang.org/x/sync v0.12.0 // indirect golang.org/x/sys v0.31.0 // indirect - golang.org/x/tools v0.30.1-0.20250221230316-5055f70f240c // indirect + golang.org/x/tools v0.31.0 // indirect golang.org/x/tools/gopls v0.18.1 // indirect honnef.co/go/tools v0.6.0 // indirect mvdan.cc/gofumpt v0.7.0 // indirect @@ -41,6 +41,7 @@ require ( tool ( github.com/mgechev/revive + golang.org/x/tools/go/analysis/passes/fieldalignment/cmd/fieldalignment golang.org/x/tools/gopls/internal/analysis/modernize/cmd/modernize honnef.co/go/tools/cmd/staticcheck mvdan.cc/gofumpt diff --git a/go.sum b/go.sum @@ -67,8 +67,8 @@ golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8 golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE= golang.org/x/exp/typeparams v0.0.0-20241210194714-1829a127f884 h1:1xaZTydL5Gsg78QharTwKfA9FY9CZ1VQj6D/AZEvHR0= golang.org/x/exp/typeparams v0.0.0-20241210194714-1829a127f884/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= -golang.org/x/mod v0.23.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= +golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= +golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -76,8 +76,8 @@ golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= -golang.org/x/tools v0.30.1-0.20250221230316-5055f70f240c h1:Ja/5gV5a9Vvho3p2NC/T2TtxhHjrWS/2DvCKMvA0a+Y= -golang.org/x/tools v0.30.1-0.20250221230316-5055f70f240c/go.mod h1:c347cR/OJfw5TI+GfX7RUPNMdDRRbjvYTS0jPyvsVtY= +golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU= +golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ= golang.org/x/tools/gopls v0.18.1 h1:2xJBNzdImS5u/kV/ZzqDLSvlBSeZX+pWY9uKVP7Pask= golang.org/x/tools/gopls v0.18.1/go.mod h1:UdNu0zeGjkmjL9L20QDszXu9tP2798pUIHC980kOBrI= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/app/commands/core.go b/internal/app/commands/core.go @@ -76,6 +76,6 @@ var ( // ReKeyArgs is the base definition of re-keying args type ReKeyArgs struct { - NoKey bool KeyFile string + NoKey bool } diff --git a/internal/app/core.go b/internal/app/core.go @@ -28,8 +28,8 @@ type ( // DefaultCommand is the default CLI app type for actual execution DefaultCommand struct { - args []string tx *backend.Transaction + args []string } ) diff --git a/internal/app/move_test.go b/internal/app/move_test.go @@ -11,11 +11,11 @@ import ( type ( mockCommand struct { - confirmed bool - confirm bool - args []string t *testing.T + args []string buf bytes.Buffer + confirmed bool + confirm bool } ) diff --git a/internal/app/rekey_test.go b/internal/app/rekey_test.go @@ -11,11 +11,11 @@ import ( type ( mockKeyer struct { + t *testing.T pass string - confirm bool args []string buf bytes.Buffer - t *testing.T + confirm bool pipe bool } ) diff --git a/internal/app/totp.go b/internal/app/totp.go @@ -30,13 +30,13 @@ type ( Mode int // TOTPArguments are the parsed TOTP call arguments TOTPArguments struct { - Mode Mode Entry string token string + Mode Mode } totpWrapper struct { - opts otp.ValidateOpts code string + opts otp.ValidateOpts } // TOTPOptions are TOTP call options TOTPOptions struct { diff --git a/internal/app/totp_test.go b/internal/app/totp_test.go @@ -14,8 +14,8 @@ import ( type ( mockOptions struct { - buf bytes.Buffer tx *backend.Transaction + buf bytes.Buffer } ) diff --git a/internal/backend/core.go b/internal/backend/core.go @@ -30,8 +30,8 @@ type ( QuerySeq2 iter.Seq2[Entity, error] // Transaction handles the overall operation of the transaction Transaction struct { - valid bool file string + valid bool exists bool write bool readonly bool diff --git a/internal/backend/hooks.go b/internal/backend/hooks.go @@ -20,8 +20,8 @@ type ( Hook struct { path string mode ActionMode - enabled bool scripts []string + enabled bool } ) diff --git a/internal/backend/query.go b/internal/backend/query.go @@ -17,9 +17,9 @@ import ( type ( // QueryOptions indicates how to find entities QueryOptions struct { + Criteria string Mode QueryMode Values ValueMode - Criteria string } // JSON is an entry as a JSON string JSON struct { diff --git a/internal/config/env.go b/internal/config/env.go @@ -16,8 +16,8 @@ type ( requirement string } environmentDefault[T any] struct { - environmentBase value T + environmentBase } environmentStrings struct { environmentDefault[string] @@ -27,8 +27,8 @@ type ( // EnvironmentInt are environment settings that are integers EnvironmentInt struct { environmentDefault[int] - canZero bool short string + canZero bool } // EnvironmentBool are environment settings that are booleans EnvironmentBool struct { @@ -36,9 +36,9 @@ type ( } // EnvironmentFormatter allows for sending a string into a get request EnvironmentFormatter struct { + fxn func(string, string) string environmentBase allowed string - fxn func(string, string) string } // EnvironmentString represents a string variable EnvironmentString struct { @@ -50,9 +50,9 @@ type ( } metaData struct { value string - allowed []string tomlType tomlType tomlValue string + allowed []string canExpand bool } ) diff --git a/internal/config/key.go b/internal/config/key.go @@ -15,8 +15,8 @@ type ( AskPassword func() (string, error) // Key is a wrapper to help manage the returned key Key struct { - inputKey []string mode KeyModeType + inputKey []string valid bool } ) diff --git a/internal/config/store/core.go b/internal/config/store/core.go @@ -15,8 +15,8 @@ type ( // KeyValue are values exportable for interrogation beyond the store KeyValue struct { - Key string Value any + Key string } ) diff --git a/justfile b/justfile @@ -30,4 +30,5 @@ lint: @go tool staticcheck -checks all -debug.run-quickfix-analyzers ./... @go tool gofumpt -l -extra {{files}} @go tool modernize -test ./... + @go tool fieldalignment ./... @go vet ./...