[#302] pkg/object: Document default values set in NewAttribute

Document field values of instance constructed via `NewAttribute`.
Assert the values in corresponding unit test.

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2021-06-08 18:52:49 +03:00 committed by Alex Vanin
parent 941b513eb3
commit ff851215b0
2 changed files with 20 additions and 0 deletions

View file

@ -17,6 +17,10 @@ func NewAttributeFromV2(aV2 *object.Attribute) *Attribute {
// NewAttribute creates and initializes blank Attribute.
//
// Works similar as NewAttributeFromV2(new(Attribute)).
//
// Defaults:
// - key: "";
// - value: "".
func NewAttribute() *Attribute {
return NewAttributeFromV2(new(object.Attribute))
}