Commit b1702b08 authored by rht's avatar rht
Browse files

Replace Critical{,f} with Error{,f}



Except when there is an explicit os.Exit(1) after the Critical line,
then replace with Fatal{,f}.
golang's log and logrus already call os.Exit(1) by default with Fatal.

License: MIT
Signed-off-by: default avatarrht <rhtbot@gmail.com>
parent f5a9795d
...@@ -24,7 +24,7 @@ type TestBogusPrivateKey []byte ...@@ -24,7 +24,7 @@ type TestBogusPrivateKey []byte
type TestBogusPublicKey []byte type TestBogusPublicKey []byte
func (pk TestBogusPublicKey) Verify(data, sig []byte) (bool, error) { func (pk TestBogusPublicKey) Verify(data, sig []byte) (bool, error) {
log.Criticalf("TestBogusPublicKey.Verify -- this better be a test!") log.Errorf("TestBogusPublicKey.Verify -- this better be a test!")
return bytes.Equal(data, reverse(sig)), nil return bytes.Equal(data, reverse(sig)), nil
} }
...@@ -33,7 +33,7 @@ func (pk TestBogusPublicKey) Bytes() ([]byte, error) { ...@@ -33,7 +33,7 @@ func (pk TestBogusPublicKey) Bytes() ([]byte, error) {
} }
func (pk TestBogusPublicKey) Encrypt(b []byte) ([]byte, error) { func (pk TestBogusPublicKey) Encrypt(b []byte) ([]byte, error) {
log.Criticalf("TestBogusPublicKey.Encrypt -- this better be a test!") log.Errorf("TestBogusPublicKey.Encrypt -- this better be a test!")
return reverse(b), nil return reverse(b), nil
} }
...@@ -51,7 +51,7 @@ func (sk TestBogusPrivateKey) GenSecret() []byte { ...@@ -51,7 +51,7 @@ func (sk TestBogusPrivateKey) GenSecret() []byte {
} }
func (sk TestBogusPrivateKey) Sign(message []byte) ([]byte, error) { func (sk TestBogusPrivateKey) Sign(message []byte) ([]byte, error) {
log.Criticalf("TestBogusPrivateKey.Sign -- this better be a test!") log.Errorf("TestBogusPrivateKey.Sign -- this better be a test!")
return reverse(message), nil return reverse(message), nil
} }
...@@ -60,7 +60,7 @@ func (sk TestBogusPrivateKey) GetPublic() ic.PubKey { ...@@ -60,7 +60,7 @@ func (sk TestBogusPrivateKey) GetPublic() ic.PubKey {
} }
func (sk TestBogusPrivateKey) Decrypt(b []byte) ([]byte, error) { func (sk TestBogusPrivateKey) Decrypt(b []byte) ([]byte, error) {
log.Criticalf("TestBogusPrivateKey.Decrypt -- this better be a test!") log.Errorf("TestBogusPrivateKey.Decrypt -- this better be a test!")
return reverse(b), nil return reverse(b), nil
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment