mirror of
https://github.com/Icinga/icingadb.git
synced 2026-05-28 04:35:54 -04:00
cmd/icingadb-migrate: replace magic number 20 with sha1.Size
This commit is contained in:
parent
b7483eb6f8
commit
b6839ce9f0
1 changed files with 3 additions and 2 deletions
|
|
@ -2,6 +2,7 @@ package main
|
|||
|
||||
import (
|
||||
"context"
|
||||
"crypto/sha1"
|
||||
"database/sql"
|
||||
_ "embed"
|
||||
"encoding/hex"
|
||||
|
|
@ -71,8 +72,8 @@ func main() {
|
|||
_, _ = fmt.Fprintf(os.Stderr, "bad env ID: %s\n", err.Error())
|
||||
os.Exit(2)
|
||||
}
|
||||
if len(envId) != 20 {
|
||||
_, _ = fmt.Fprintf(os.Stderr, "bad env ID: must be 20 bytes long, has %d bytes\n", len(envId))
|
||||
if len(envId) != sha1.Size {
|
||||
_, _ = fmt.Fprintf(os.Stderr, "bad env ID: must be %d bytes long, has %d bytes\n", sha1.Size, len(envId))
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue