-
Notifications
You must be signed in to change notification settings - Fork 260
chore: appease the linter, pt 1 of ? #922
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -139,7 +139,7 @@ func main() { | |
| tb.ConnectToTelemetryService(telemetryNumRetries, telemetryWaitTimeInMilliseconds) | ||
| defer tb.Close() | ||
|
|
||
| for true { | ||
| for { | ||
| config.Store, err = store.NewJsonFileStore(platform.CNIRuntimePath + pluginName + ".json") | ||
| if err != nil { | ||
| fmt.Printf("[monitor] Failed to create store: %v\n", err) | ||
|
|
@@ -178,6 +178,4 @@ func main() { | |
| time.Sleep(time.Duration(timeout) * time.Second) | ||
| nm = nil | ||
| } | ||
|
|
||
| log.Close() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Dont we have to defer log.close() this ?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. since the above
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. its good practice to have defer log.Close()..if someone changes this behaviour tomorrow, then they may fail to add log.close()
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @tamilmani1989 I read through the log package and I don't think it's safe to call |
||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -189,7 +189,7 @@ func BlockIPAddresses(bridgeName string, action string) error { | |
| func EnableIPForwarding(ifName string) error { | ||
| // Enable ip forwading on linux vm. | ||
| // sysctl -w net.ipv4.ip_forward=1 | ||
| cmd := fmt.Sprintf(enableIPForwardCmd) | ||
| cmd := fmt.Sprint(enableIPForwardCmd) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we change this? what's the use?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we are not doing a string interpolation so it's unnecessary to call |
||
| _, err := platform.ExecuteCommand(cmd) | ||
| if err != nil { | ||
| log.Printf("[net] Enable ipforwarding failed with: %v", err) | ||
|
|
@@ -206,7 +206,7 @@ func EnableIPForwarding(ifName string) error { | |
| } | ||
|
|
||
| func EnableIPV6Forwarding() error { | ||
| cmd := fmt.Sprintf(enableIPV6ForwardCmd) | ||
| cmd := fmt.Sprint(enableIPV6ForwardCmd) | ||
| _, err := platform.ExecuteCommand(cmd) | ||
| if err != nil { | ||
| log.Printf("[net] Enable ipv6 forwarding failed with: %v", err) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did we test this change?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
os.Killcannot be trapped, so including it in theNotifylist is ineffective.