Skip to content

refactor: Drop C usage in ax25_pad2.go#377

Merged
doismellburning merged 1 commit intomainfrom
feature/go-ax25_pad2
Feb 15, 2026
Merged

refactor: Drop C usage in ax25_pad2.go#377
doismellburning merged 1 commit intomainfrom
feature/go-ax25_pad2

Conversation

@doismellburning
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings February 15, 2026 12:50
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

This pull request refactors the ax25_pad2.go file to eliminate C interop (cgo) dependencies, replacing C pointer arithmetic and memory operations with native Go equivalents. This improves code maintainability, removes the dependency on the unsafe package, and actually fixes a memory leak that existed in the original code.

Changes:

  • Removed C imports (import "C" and unsafe package) and added bytes package
  • Replaced C pointer arithmetic with direct Go array indexing
  • Replaced C memory operations (C.memcpy, C.memset, C.CBytes) with native Go functions (copy, bytes.Repeat)
  • Removed unnecessary null terminators that were only needed for C string compatibility
  • Changed type signatures from C.int to int for consistency with Go conventions

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

@doismellburning doismellburning merged commit 3231ba1 into main Feb 15, 2026
2 checks passed
@doismellburning doismellburning deleted the feature/go-ax25_pad2 branch February 15, 2026 13:01
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.

1 participant