mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-23 17:59:41 +02:00
tlv: make TlvType method for TlvType interface public
With this change, callers can now examine a struct instance of the `TlvType` instance to figure out programmatically which integer type is maps to. This'll be useful when decoding optional TLV types into a wire struct (knowing when to set it to Some vs None).
This commit is contained in:
@@ -20,10 +20,12 @@ package tlv
|
||||
|
||||
type tlvType{{ $index }} struct{}
|
||||
|
||||
func (t *tlvType{{ $index }}) typeVal() Type {
|
||||
func (t *tlvType{{ $index }}) TypeVal() Type {
|
||||
return {{ $index }}
|
||||
}
|
||||
|
||||
func (t *tlvType{{ $index }}) tlv() {}
|
||||
|
||||
type TlvType{{ $index }} = *tlvType{{ $index }}
|
||||
{{- end }}
|
||||
`
|
||||
|
Reference in New Issue
Block a user