[#302] pkg/container: 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 15:33:42 +03:00 committed by Alex Vanin
parent 8b7a433864
commit 3984353d37
2 changed files with 18 additions and 0 deletions

View file

@ -9,6 +9,11 @@ type (
Attributes []*Attribute
)
// NewAttribute creates and initializes blank Attribute.
//
// Defaults:
// - key: "";
// - value: "".
func NewAttribute() *Attribute {
return NewAttributeFromV2(new(container.Attribute))
}