From 33a6686e2bc126916145f01246ee6be80669dcdb Mon Sep 17 00:00:00 2001 From: "Andrew G. Morgan" Date: Fri, 17 Sep 2021 21:07:19 -0700 Subject: More compliant cap.Differs documentation. Deprecation has a stylized comment format as per go.dev. Signed-off-by: Andrew G. Morgan --- cap/flags.go | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/cap/flags.go b/cap/flags.go index 88ad355..df7a9a5 100644 --- a/cap/flags.go +++ b/cap/flags.go @@ -208,9 +208,23 @@ func (c *Set) Cf(d *Set) (Diff, error) { // Differs processes the result of Compare and determines if the // Flag's components were different. // -// Use of this function is deprecated in favor of the (Diff).Has() -// function, where Diff is returned as a result of the (*Set).Cf() -// function. +// Deprecated: Replace with (Diff).Has(). +// +// Example, replace this: +// +// diff, err := a.Compare(b) +// ... +// if diff & (1 << Effective) { +// ... different effective capabilities ... +// } +// +// with this: +// +// diff, err := a.Cf(b) +// ... +// if diff.Has(Effective) { +// ... different effective capabilities ... +// } func Differs(cf uint, vec Flag) bool { return cf&(1<