From 74e36f0ead717105f26087c2cab08b41ba5a7ce8 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Mon, 12 Feb 2024 19:18:05 +0100 Subject: All: Document everything to pass revive lint --- types/cookie/cookie.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'types/cookie') diff --git a/types/cookie/cookie.go b/types/cookie/cookie.go index 1714682..48c8dbf 100644 --- a/types/cookie/cookie.go +++ b/types/cookie/cookie.go @@ -1,4 +1,4 @@ -// package cookie implements a specialized version of a context +// Package cookie implements a specialized version of a context // - It is cancellable // - It has a channel associated with it to reply to state callbacks // - It can be marshalled by having a cgo Handle attached to it @@ -12,6 +12,8 @@ import ( "runtime/cgo" ) +// Cookie is the cookie which is just a context with some other data associated with it +// We could potentially only uses contexts with values, but this is nicer for type checking type Cookie struct { c chan string ctx context.Context @@ -19,8 +21,10 @@ type Cookie struct { H cgo.Handle } +// contextt is the context type for the value type contextt int8 +// CONTEXTK is the key of the cookie const CONTEXTK contextt = 0 // NewWithContext creates a new cookie with a context -- cgit v1.2.3