From 2fff3fd9ecf75aa7e6238ecb3c35adb866d7be0c Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Tue, 1 Feb 2022 13:21:25 +0300 Subject: [PATCH] [#128] session: Sync comments and constructors Signed-off-by: Pavel Karpy --- session/container.go | 8 ++++---- session/object.go | 6 +++--- session/session.go | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/session/container.go b/session/container.go index ec824857..ed754560 100644 --- a/session/container.go +++ b/session/container.go @@ -22,12 +22,12 @@ func NewContainerContext() *ContainerContext { v2 := new(session.ContainerSessionContext) v2.SetWildcard(true) - return ContainerContextFromV2(v2) + return NewContainerContextFromV2(v2) } -// ContainerContextFromV2 wraps session.ContainerSessionContext +// NewContainerContextFromV2 wraps session.ContainerSessionContext // into ContainerContext. -func ContainerContextFromV2(v *session.ContainerSessionContext) *ContainerContext { +func NewContainerContextFromV2(v *session.ContainerSessionContext) *ContainerContext { return (*ContainerContext)(v) } @@ -47,7 +47,7 @@ func (x *ContainerContext) ApplyTo(id *cid.ID) { v2.SetContainerID(id.ToV2()) } -// ActOnAllContainers is a helper function that conveniently +// ApplyToAllContainers is a helper function that conveniently // applies ContainerContext to all containers. func ApplyToAllContainers(c *ContainerContext) { c.ApplyTo(nil) diff --git a/session/object.go b/session/object.go index e9be63a0..8dfb3440 100644 --- a/session/object.go +++ b/session/object.go @@ -21,12 +21,12 @@ type ObjectContext session.ObjectSessionContext func NewObjectContext() *ObjectContext { v2 := new(session.ObjectSessionContext) - return ObjectContextFromV2(v2) + return NewObjectContextFromV2(v2) } -// ObjectContextFromV2 wraps session.ObjectSessionContext +// NewObjectContextFromV2 wraps session.ObjectSessionContext // into ObjectContext. -func ObjectContextFromV2(v *session.ObjectSessionContext) *ObjectContext { +func NewObjectContextFromV2(v *session.ObjectSessionContext) *ObjectContext { return (*ObjectContext)(v) } diff --git a/session/session.go b/session/session.go index 119eca6f..ffefb3af 100644 --- a/session/session.go +++ b/session/session.go @@ -236,9 +236,9 @@ func (t *Token) Context() interface{} { default: return nil case *session.ContainerSessionContext: - return ContainerContextFromV2(c) + return NewContainerContextFromV2(c) case *session.ObjectSessionContext: - return ObjectContextFromV2(c) + return NewObjectContextFromV2(c) } }