Skip to content

Commit

Permalink
Linter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicletz committed Aug 4, 2022
1 parent f5845f8 commit 5c607be
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cmd/diode/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ func configHandler() (err error) {
cfg.PrintError("Failed setting key", err)
return
}
if rpc.ValidatePrivatePEM(value) == false {
cfg.PrintError("Failed setting key", fmt.Errorf("Invalid private key value %v", value))
if rpc.ValidatePrivatePEM(value) {
cfg.PrintError("Failed setting key", fmt.Errorf("invalid private key value %v", value))
return
}
}
Expand Down
4 changes: 2 additions & 2 deletions db/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ func (db *Database) Put(key string, value []byte) (err error) {
err = db.store()
db.rm.Unlock()

if err == nil && db.backup_keys[key] == true {
if err == nil && db.backup_keys[key] {
db.doBackup(key)
}
return err
Expand Down Expand Up @@ -220,7 +220,7 @@ func (origin *Database) doBackup(key string) {
backupValue, _ := backup.Get(key)
if originValue != nil {
// Creating backup store if not existing or different from original value
if backupValue == nil || bytes.Compare(originValue, backupValue) != 0 {
if backupValue == nil || !bytes.Equal(originValue, backupValue) {
backup.Put(key, originValue)
}
} else if backupValue != nil {
Expand Down
2 changes: 1 addition & 1 deletion rpc/ssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func LoadPrivateKey(bytes []byte) ([]byte, error) {
func EnsurePrivatePEM() []byte {
key, _ := db.DB.Get("private")

if ValidatePrivatePEM(key) == false {
if !ValidatePrivatePEM(key) {
privKey, err := openssl.GenerateECKey(openssl.Secp256k1)
if err != nil {
config.AppConfig.Logger.Error("Failed to generate ec key: %v", err)
Expand Down

0 comments on commit 5c607be

Please sign in to comment.