Skip to content

Commit

Permalink
adopt gofumpt | update cli
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettladley committed Feb 1, 2024
1 parent 33b1616 commit a58d2cc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions backend/src/auth/password.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ func decodeHash(encodedHash string) (p *params, salt []byte, hash []byte, err er
var version int

_, err = fmt.Sscanf(vals[2], "v=%d", &version)

if err != nil {
return nil, nil, nil, err
}
Expand All @@ -93,21 +92,18 @@ func decodeHash(encodedHash string) (p *params, salt []byte, hash []byte, err er
p = &params{}

_, err = fmt.Sscanf(vals[3], "m=%d,t=%d,p=%d", &p.memory, &p.iterations, &p.parallelism)

if err != nil {
return nil, nil, nil, err
}

salt, err = base64.RawStdEncoding.Strict().DecodeString(vals[4])

if err != nil {
return nil, nil, nil, err
}

p.saltLength = uint32(len(salt))

hash, err = base64.RawStdEncoding.Strict().DecodeString(vals[5])

if err != nil {
return nil, nil, nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion cli/commands/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func Format(folder string, runFrontend bool, runBackend bool) error {
func BackendFormat() error {
fmt.Println("Formatting backend")

cmd := exec.Command("go", "fmt", "./...")
cmd := exec.Command("gofumpt", "-l", "-w", ".")
cmd.Dir = BACKEND_DIR

err := cmd.Run()
Expand Down

0 comments on commit a58d2cc

Please sign in to comment.