From ea29e6bad114306b78820cb674863a9bf3041fa5 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 27 Oct 2026 20:13:13 +0900 Subject: internal/pipewire: re-format for readability This package was the first somewhat large piece of code that was primarily written using the built-in display of my laptop. The experience had been deeply unpleasant due to the awkward 3:2 aspect ratio not working well with my setup, which almost always involved having the implementation and tests side-by-side. This experience is what provoked me to re-instate the 80-column limit that I had long resented and rejected. This package however predates the formal re-instating of this limit, and was never updated. Signed-off-by: Ophestra --- internal/pipewire/header.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'internal/pipewire/header.go') diff --git a/internal/pipewire/header.go b/internal/pipewire/header.go index 3aecfb7d..a627db24 100644 --- a/internal/pipewire/header.go +++ b/internal/pipewire/header.go @@ -8,14 +8,17 @@ import ( const ( // SizeHeader is the fixed size of [Header]. SizeHeader = 16 - // SizeMax is the largest value of [Header.Size] that can be represented in its 3-byte segment. + // SizeMax is the largest value of [Header.Size] that can be represented in + // its 3-byte segment. SizeMax = 0x00ffffff ) var ( - // ErrSizeRange indicates that the value of [Header.Size] cannot be represented in its 3-byte segment. + // ErrSizeRange indicates that the value of [Header.Size] cannot be + // represented in its 3-byte segment. ErrSizeRange = errors.New("size out of range") - // ErrBadHeader indicates that the header slice does not have length [HeaderSize]. + // ErrBadHeader indicates that the header slice does not have length + // [SizeHeader]. ErrBadHeader = errors.New("incorrect header size") ) @@ -26,6 +29,7 @@ type Header struct { // The opcode on the resource/proxy interface. Opcode byte `json:"opcode"` // The size of the payload and optional footer of the message. + // // Note: this value is only 24 bits long in the format. Size uint32 `json:"size"` // An increasing sequence number for each message. -- cgit v1.3.1