lnwire: modify newAlias to no longer return an error
This commit is contained in:
3 files changed
+5
-11
No files matched your search
+1
-4
@@ -747,10 +747,7 @@ func readElement(r io.Reader, element interface{}) error {
|
||||
return err
|
||||
}
|
||||
|
||||
*e, err = newAlias(a[:])
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
*e = newAlias(a[:])
|
||||
default:
|
||||
return fmt.Errorf("Unknown type in readElement: %T", e)
|
||||
}
|
||||
|
||||
@@ -31,12 +31,12 @@ type Alias struct {
|
||||
}
|
||||
|
||||
// NewAlias create the alias from string and also checks spec requirements.
|
||||
func NewAlias(s string) (Alias, error) {
|
||||
func NewAlias(s string) Alias {
|
||||
data := []byte(s)
|
||||
return newAlias(data)
|
||||
}
|
||||
|
||||
func newAlias(data []byte) (Alias, error) {
|
||||
func newAlias(data []byte) Alias {
|
||||
var a [32]byte
|
||||
|
||||
rawAlias := data
|
||||
@@ -54,7 +54,7 @@ func newAlias(data []byte) (Alias, error) {
|
||||
return Alias{
|
||||
data: a,
|
||||
aliasLen: aliasEnd,
|
||||
}, nil
|
||||
}
|
||||
}
|
||||
|
||||
func (a *Alias) String() string {
|
||||
|
||||
Reference in new issue
Block a user