Skip to content

Refactor Build for Go - #753

Merged
raykroeker merged 6 commits into
mainfrom
raykroeker/006-cni-productization-buildfiles
Jun 9, 2026
Merged

raykroeker merged 6 commits into
mainfrom
raykroeker/006-cni-productization-buildfiles

Conversation

@raykroeker

Copy link
Copy Markdown
Member
  • Add go.just and write generic recipes for build, test and lint for go.
  • Adjust github workflow for go to use general recipe for testing.
  • Add meta-recipes go-build and go-test to build and test all go binary and library code.
  • Adjust go-lint to cover the internal pkg/ package.
  • Add flag to gofmt to report all issues (-e) versus the first 10.
  • Adjust recipe dependencies and remove specific recipes in favour of general ones.A
  • Fix lint issues in the iptables package.

 * Add go.just and write generic recipes for build, test and lint for
   go.
 * Adjust github workflow for go to use general recipe for testing.
 * Add meta-recipes go-build and go-test to build and test all go binary
   and library code.
 * Adjust go-lint to cover the internal pkg/ package.
 * Add flag to gofmt to report all issues (-e) versus the first 10.
 * Adjust recipe dependencies and remove specific recipes in favour of
   general ones.A
 * Fix lint issues in the iptables package.
if !reflect.DeepEqual(tt.expected, check) {
t.Fatalf("expected port range does not match check '%v'<>'%v'",
tt.expected, check)
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Adding lint checks to pkg/ indicated t was unused.

Comment thread pkg/iptables/iptables.go
func (fc FirewallConfiguration) makeJumpFromChainToAnotherForAllProtocols(chainName string, targetChain string, comment string, deleteChain bool) *exec.Cmd {
action := "-A"
if delete {
if deleteChain {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

delete is a lint trigger.

Comment thread pkg/iptables/iptables.go
destinationSlices := make([][]string, 0)
destinationPortCount := 0
if portsToIgnore == nil || len(portsToIgnore) < 1 {
if len(portsToIgnore) < 1 {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

portsToIgnore == nil is a lint triger.

@raykroeker
raykroeker marked this pull request as ready for review June 8, 2026 21:39
@raykroeker
raykroeker requested a review from a team as a code owner June 8, 2026 21:39

@alpeb alpeb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 👍

@raykroeker
raykroeker merged commit ec87bd6 into main Jun 9, 2026
20 checks passed
@raykroeker
raykroeker deleted the raykroeker/006-cni-productization-buildfiles branch June 9, 2026 18: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.

2 participants