Skip to content

Refactor Build for Go#753

Draft
raykroeker wants to merge 1 commit into
mainfrom
raykroeker/006-cni-productization-buildfiles
Draft

Refactor Build for Go#753
raykroeker wants to merge 1 commit into
mainfrom
raykroeker/006-cni-productization-buildfiles

Conversation

@raykroeker
Copy link
Copy Markdown

  • 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
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
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
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.

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