File tree 2 files changed +13
-4
lines changed
2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change 12
12
13
13
## Migration tips for v0.15
14
14
15
- - If your use case supports it, prefer ` append ` to append a Component to a
16
- Multiaddr rather than using ` Encapsulate ` . It's much faster as it does not do
17
- a defensive copy.
15
+ - If appending a ` *Component ` to a ` Multiaddr ` , prefer the
16
+ ` Multiaddr.AppendComponent ` method as it will perform a nil pointer check on
17
+ the ` *Component ` before appending. If you know a ` *Component ` is not nil, you
18
+ may use ` append ` normally.
19
+ - the ` Multiaddr ` type is simply a ` []Component ` .
20
+ - You can use ` append ` when you have a ` Component ` .
21
+ - You can use ` for range ` loops.
22
+ - If your use case supports it, prefer ` append ` or ` AppendComponent ` to append a
23
+ Component to a Multiaddr rather than using ` Encapsulate ` or ` Join ` . It's much
24
+ faster as it does not do a defensive copy.
25
+ - Likewise, to join two Multiaddrs, ` append ` will perform better than
26
+ ` Encapsulate ` or ` Join ` .
Original file line number Diff line number Diff line change 1
1
{
2
- "version" : " v0.14 .0"
2
+ "version" : " v0.15 .0"
3
3
}
You can’t perform that action at this time.
0 commit comments