detached 799bcb0

cleanup: remove unused placeholder fields and helper constructors

Remove unused struct fields from Context, Core, Registry, and Stream
that were causing staticcheck U1000 warnings:
- Context: capi, core fields
- Core: capi, context fields (and newCore helper)
- Registry: capi, core fields (and newRegistry helper)
- Stream: capi, core fields

Also removes unused portout imports from these files.

Behavior preserved: all tests pass, public API unchanged,
skeleton methods remain for Task 4 implementation.
commit
799bcb0a739e8175e979ca5eb85dc923a923cf8f
author
brice · · 2026-04-09 06:08 UTC
parent
ccafe44
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
4 files · +1 -33
M internal/core/context.go +1 -5
@@ -3,16 +3,12 @@ package core
33 import (
44 "errors"
55 "unsafe"
6-
7- portout "github.com/bnema/purego-pipewire/internal/ports/out"
86 )
97
108 var ErrContextCreate = errors.New("failed to create context")
119
1210 type Context struct {
13- ptr unsafe.Pointer
14- capi portout.CAPI
15- core *Core
11+ ptr unsafe.Pointer
1612 }
1713
1814 func (r *Runtime) NewContext() (*Context, error) {
@@ -3,16 +3,12 @@ package core
3 import (3 import (
4 "errors"4 "errors"
5 "unsafe"5 "unsafe"
6-
7- portout "github.com/bnema/purego-pipewire/internal/ports/out"
8 )6 )
9 7
10 var ErrContextCreate = errors.New("failed to create context")8 var ErrContextCreate = errors.New("failed to create context")
11 9
12 type Context struct {10 type Context struct {
13- ptr unsafe.Pointer11+ ptr unsafe.Pointer
14- capi portout.CAPI
15- core *Core
16 }12 }
17 13
18 func (r *Runtime) NewContext() (*Context, error) {14 func (r *Runtime) NewContext() (*Context, error) {
M internal/core/core.go +0 -12
@@ -3,8 +3,6 @@ package core
33 import (
44 "errors"
55 "unsafe"
6-
7- portout "github.com/bnema/purego-pipewire/internal/ports/out"
86 )
97
108 var ErrCoreConnect = errors.New("failed to connect core")
@@ -12,19 +10,9 @@ var ErrRegistryUnavailable = errors.New("registry unavailable")
1210
1311 type Core struct {
1412 ptr unsafe.Pointer
15- capi portout.CAPI
16- context *Context
1713 registry *Registry
1814 }
1915
20-func (c *Context) newCore(ptr unsafe.Pointer) *Core {
21- return &Core{
22- ptr: ptr,
23- capi: c.capi,
24- context: c,
25- }
26-}
27-
2816 func (c *Core) Disconnect() {
2917 // Placeholder for core disconnection
3018 }
@@ -3,8 +3,6 @@ package core
3 import (3 import (
4 "errors"4 "errors"
5 "unsafe"5 "unsafe"
6-
7- portout "github.com/bnema/purego-pipewire/internal/ports/out"
8 )6 )
9 7
10 var ErrCoreConnect = errors.New("failed to connect core")8 var ErrCoreConnect = errors.New("failed to connect core")
@@ -12,19 +10,9 @@ var ErrRegistryUnavailable = errors.New("registry unavailable")
12 10
13 type Core struct {11 type Core struct {
14 ptr unsafe.Pointer12 ptr unsafe.Pointer
15- capi portout.CAPI
16- context *Context
17 registry *Registry13 registry *Registry
18 }14 }
19 15
20-func (c *Context) newCore(ptr unsafe.Pointer) *Core {
21- return &Core{
22- ptr: ptr,
23- capi: c.capi,
24- context: c,
25- }
26-}
27-
28 func (c *Core) Disconnect() {16 func (c *Core) Disconnect() {
29 // Placeholder for core disconnection17 // Placeholder for core disconnection
30 }18 }
M internal/core/registry.go +0 -12
@@ -3,27 +3,15 @@ package core
33 import (
44 "errors"
55 "unsafe"
6-
7- portout "github.com/bnema/purego-pipewire/internal/ports/out"
86 )
97
108 var ErrRegistryCreate = errors.New("failed to create registry")
119
1210 type Registry struct {
1311 ptr unsafe.Pointer
14- capi portout.CAPI
15- core *Core
1612 hooks []unsafe.Pointer
1713 }
1814
19-func (c *Core) newRegistry(ptr unsafe.Pointer) *Registry {
20- return &Registry{
21- ptr: ptr,
22- capi: c.capi,
23- core: c,
24- }
25-}
26-
2715 func (r *Registry) Destroy() {
2816 // Clean up any registered hooks
2917 for _, hook := range r.hooks {
@@ -3,27 +3,15 @@ package core
3 import (3 import (
4 "errors"4 "errors"
5 "unsafe"5 "unsafe"
6-
7- portout "github.com/bnema/purego-pipewire/internal/ports/out"
8 )6 )
9 7
10 var ErrRegistryCreate = errors.New("failed to create registry")8 var ErrRegistryCreate = errors.New("failed to create registry")
11 9
12 type Registry struct {10 type Registry struct {
13 ptr unsafe.Pointer11 ptr unsafe.Pointer
14- capi portout.CAPI
15- core *Core
16 hooks []unsafe.Pointer12 hooks []unsafe.Pointer
17 }13 }
18 14
19-func (c *Core) newRegistry(ptr unsafe.Pointer) *Registry {
20- return &Registry{
21- ptr: ptr,
22- capi: c.capi,
23- core: c,
24- }
25-}
26-
27 func (r *Registry) Destroy() {15 func (r *Registry) Destroy() {
28 // Clean up any registered hooks16 // Clean up any registered hooks
29 for _, hook := range r.hooks {17 for _, hook := range r.hooks {
M internal/core/stream.go +0 -4
@@ -3,16 +3,12 @@ package core
33 import (
44 "errors"
55 "unsafe"
6-
7- portout "github.com/bnema/purego-pipewire/internal/ports/out"
86 )
97
108 var ErrStreamCreate = errors.New("failed to create stream")
119
1210 type Stream struct {
1311 ptr unsafe.Pointer
14- capi portout.CAPI
15- core *Core
1612 destroy func()
1713 }
1814
@@ -3,16 +3,12 @@ package core
3 import (3 import (
4 "errors"4 "errors"
5 "unsafe"5 "unsafe"
6-
7- portout "github.com/bnema/purego-pipewire/internal/ports/out"
8 )6 )
9 7
10 var ErrStreamCreate = errors.New("failed to create stream")8 var ErrStreamCreate = errors.New("failed to create stream")
11 9
12 type Stream struct {10 type Stream struct {
13 ptr unsafe.Pointer11 ptr unsafe.Pointer
14- capi portout.CAPI
15- core *Core
16 destroy func()12 destroy func()
17 }13 }
18 14

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 8

↑↓ moveenter openesc close