Skip to content

chore: remove useless cgo imports#2115

Open
dunglas wants to merge 4 commits intomainfrom
chore/remove-useless-cgo-imports
Open

chore: remove useless cgo imports#2115
dunglas wants to merge 4 commits intomainfrom
chore/remove-useless-cgo-imports

Conversation

@dunglas
Copy link
Member

@dunglas dunglas commented Jan 8, 2026

No description provided.

@@ -1,6 +1,5 @@
package phpheaders

import "C"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not having import "C" in modules makes test ./... fail sometimes.

It's a weird bug with cgo gcc linking.

@alexandre-daubois alexandre-daubois force-pushed the chore/remove-useless-cgo-imports branch from 1e10aca to 032c373 Compare February 22, 2026 11:46
Signed-off-by: Kévin Dunglas <kevin@dunglas.fr>
Copilot AI review requested due to automatic review settings March 10, 2026 10:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes unnecessary cgo triggers/imports and an unused C header include, reducing build overhead (especially avoiding needless cgo requirements in otherwise pure-Go internal packages).

Changes:

  • Removed unused import "C" (and cgo preamble) from worker.go.
  • Removed unused import "C" from internal/state and internal/phpheaders to keep them pure-Go.
  • Dropped the unused <unistd.h> include from frankenphp.c.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
worker.go Removes redundant cgo preamble/import that wasn’t referenced.
internal/state/state.go Removes cgo import so the package no longer unnecessarily requires cgo.
internal/phpheaders/phpheaders.go Removes cgo import so the package remains pure-Go.
frankenphp.c Removes an unused POSIX header include (unistd.h).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants