ofnet_test.go: write some loops as functions#86
Open
unclejack wants to merge 1 commit intocontiv:masterfrom
Open
ofnet_test.go: write some loops as functions#86unclejack wants to merge 1 commit intocontiv:masterfrom
unclejack wants to merge 1 commit intocontiv:masterfrom
Conversation
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
|
This increases the readability of the code, so I am fine with it. What do you guys say? |
dseevr
reviewed
Sep 12, 2017
Contributor
dseevr
left a comment
There was a problem hiding this comment.
Changes look fine to me, just some minor pedantry
| vxlanAgents[i] = agent | ||
| case "vrtr": | ||
| vrtrAgents[i] = agent | ||
| } |
Contributor
There was a problem hiding this comment.
I'd add a default case here which panics/logs a fatal error just to be pedantic
| j := ovsDriversOffset + i | ||
| ovsDrivers[j] = ovsdbDriver.NewOvsDriver(brName) | ||
| err := ovsDrivers[j].AddController("127.0.0.1", ovsPort) | ||
| if err != nil { |
| brName := fmt.Sprintf("%vBridge%v", brPrefix, i) | ||
| log.Infof("deleting OVS bridge: %s", brName) | ||
| err := ovsDrivers[ovsDriversOffset+i].DeleteBridge(brName) | ||
| if err != nil { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR rewrites some loops as functions. This makes it easier to update this code in the future.
This PR doesn't fix any bugs. It can be reviewed and merged when there's time.