[#607] network: Do not work with Address pointers

`network.Address` structure in most cases created once and used read-only.

Replace `AddressFromString` function with `Address.FromString` method with
the same purpose and implementation. Make all libraries to work with value.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-06-18 09:00:21 +03:00 committed by Leonard Lyubich
parent 5de074f24c
commit adbbad0beb
35 changed files with 128 additions and 97 deletions

View file

@ -43,7 +43,9 @@ func TestAddress_AddTLS(t *testing.T) {
addr.AddTLS()
netAddr, err := AddressFromString(test.want)
var netAddr Address
err := netAddr.FromString(test.want)
require.NoError(t, err)
require.True(t, netAddr.Equal(addr), test.input)