diff options
author | Carl Baldwin <carl@ecbaldwin.net> | 2019-07-24 09:01:23 -0600 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-08-28 09:06:20 +0900 |
commit | 02863c581d653fd4bedcfd0da991e27943c95149 (patch) | |
tree | 8bc681460d33de46defcee517e46a68df6d580d8 /cmd/gobgpd/main.go | |
parent | 72094dfceeaa083e1e59ed9a64dc12cede4ad43e (diff) |
Move assignement of current config to the end
Now that `c` is no longer referenced in the block above, its
assignement can be moved to later. This allows consolidating the two
assignements into one and moving them to the very end to magic the
logic clearer.
Diffstat (limited to 'cmd/gobgpd/main.go')
-rw-r--r-- | cmd/gobgpd/main.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/cmd/gobgpd/main.go b/cmd/gobgpd/main.go index 569c2daa..8abcc072 100644 --- a/cmd/gobgpd/main.go +++ b/cmd/gobgpd/main.go @@ -236,7 +236,6 @@ func main() { var updatePolicy bool if c == nil { - c = newConfig if err := bgpServer.StartBgp(context.Background(), &api.StartBgpRequest{ Global: config.NewGlobalFromConfigStruct(&newConfig.Global), }); err != nil { @@ -372,7 +371,6 @@ func main() { assignGlobalpolicy(bgpServer, &newConfig.Global.ApplyPolicy.Config) updatePolicy = true } - c = newConfig } for _, pg := range addedPg { log.Infof("PeerGroup %s is added", pg.Config.PeerGroupName) @@ -447,6 +445,7 @@ func main() { log.Warn(err) } } + c = newConfig } } } |