mirror of
https://github.com/go-micro/go-micro.git
synced 2025-08-04 21:42:57 +02:00
fix: some linting issues (#2563)
This commit is contained in:
@ -18,7 +18,7 @@ type box struct {
|
||||
privateKey [keyLength]byte
|
||||
}
|
||||
|
||||
// NewSecrets returns a nacl-box codec
|
||||
// NewSecrets returns a nacl-box codec.
|
||||
func NewSecrets(opts ...secrets.Option) secrets.Secrets {
|
||||
b := &box{}
|
||||
for _, o := range opts {
|
||||
@ -27,7 +27,6 @@ func NewSecrets(opts ...secrets.Option) secrets.Secrets {
|
||||
return b
|
||||
}
|
||||
|
||||
// Init initialises a box
|
||||
func (b *box) Init(opts ...secrets.Option) error {
|
||||
for _, o := range opts {
|
||||
o(&b.options)
|
||||
@ -40,17 +39,17 @@ func (b *box) Init(opts ...secrets.Option) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Options returns options
|
||||
// Options returns options.
|
||||
func (b *box) Options() secrets.Options {
|
||||
return b.options
|
||||
}
|
||||
|
||||
// String returns nacl-box
|
||||
// String returns nacl-box.
|
||||
func (*box) String() string {
|
||||
return "nacl-box"
|
||||
}
|
||||
|
||||
// Encrypt encrypts a message with the sender's private key and the receipient's public key
|
||||
// Encrypt encrypts a message with the sender's private key and the receipient's public key.
|
||||
func (b *box) Encrypt(in []byte, opts ...secrets.EncryptOption) ([]byte, error) {
|
||||
var options secrets.EncryptOptions
|
||||
for _, o := range opts {
|
||||
@ -68,7 +67,7 @@ func (b *box) Encrypt(in []byte, opts ...secrets.EncryptOption) ([]byte, error)
|
||||
return naclbox.Seal(nonce[:], in, &nonce, &recipientPublicKey, &b.privateKey), nil
|
||||
}
|
||||
|
||||
// Decrypt Decrypts a message with the receiver's private key and the sender's public key
|
||||
// Decrypt Decrypts a message with the receiver's private key and the sender's public key.
|
||||
func (b *box) Decrypt(in []byte, opts ...secrets.DecryptOption) ([]byte, error) {
|
||||
var options secrets.DecryptOptions
|
||||
for _, o := range opts {
|
||||
|
Reference in New Issue
Block a user