Remove pointer methods

This commit is contained in:
mcrakhman 2023-03-27 01:57:49 +02:00 committed by Mikhail Iudin
parent b3a4272188
commit 72a64afbec
No known key found for this signature in database
GPG Key ID: FAAAA8BAABDFF1C0

View File

@ -22,7 +22,7 @@ func NewMnemonicGenerator() MnemonicGenerator {
type Mnemonic string type Mnemonic string
func (g *MnemonicGenerator) WithWordCount(wc int) (Mnemonic, error) { func (g MnemonicGenerator) WithWordCount(wc int) (Mnemonic, error) {
size := 0 size := 0
switch wc { switch wc {
case 12: case 12:
@ -41,7 +41,7 @@ func (g *MnemonicGenerator) WithWordCount(wc int) (Mnemonic, error) {
return g.WithWordCount(size) return g.WithWordCount(size)
} }
func (g *MnemonicGenerator) WithRandomEntropy(size int) (Mnemonic, error) { func (g MnemonicGenerator) WithRandomEntropy(size int) (Mnemonic, error) {
entropy, err := bip39.NewEntropy(size) entropy, err := bip39.NewEntropy(size)
if err != nil { if err != nil {
return "", err return "", err
@ -53,7 +53,7 @@ func (g *MnemonicGenerator) WithRandomEntropy(size int) (Mnemonic, error) {
return Mnemonic(mnemonic), nil return Mnemonic(mnemonic), nil
} }
func (g *MnemonicGenerator) WithEntropy(b []byte) (Mnemonic, error) { func (g MnemonicGenerator) WithEntropy(b []byte) (Mnemonic, error) {
mnemonic, err := bip39.NewMnemonic(b) mnemonic, err := bip39.NewMnemonic(b)
if err != nil { if err != nil {
return "", err return "", err