From 11dda8300d3872f9414e7fff0402fd6fcbf6d537 Mon Sep 17 00:00:00 2001 From: "Igor D.C" Date: Wed, 29 Jul 2020 01:37:15 +0000 Subject: DCM - fix code formatting via vscode (II) Part two of fixing code format/syntax with Visual Studio Code. Furthermore, also switched line endings from CRLF to LF (all test files seemed to be ending this way, unlike the other Go files). Issue-ID: MULTICLOUD-1143 Signed-off-by: Igor D.C Change-Id: Iaae868c780a42ea82ca1208e3cbdc3ec6ffd1f97 --- src/dcm/cmd/main.go | 98 ++++++++++++++++++++++++++--------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) (limited to 'src/dcm/cmd') diff --git a/src/dcm/cmd/main.go b/src/dcm/cmd/main.go index 77d5348b..c08330fa 100644 --- a/src/dcm/cmd/main.go +++ b/src/dcm/cmd/main.go @@ -14,65 +14,65 @@ limitations under the License. package main import ( - "context" - "log" - "math/rand" - "net/http" - "os" - "os/signal" - "time" + "context" + "log" + "math/rand" + "net/http" + "os" + "os/signal" + "time" - "github.com/onap/multicloud-k8s/src/dcm/api" - "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/auth" - "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/config" - "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/db" - contextDb "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/contextdb" - "github.com/gorilla/handlers" + "github.com/gorilla/handlers" + "github.com/onap/multicloud-k8s/src/dcm/api" + "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/auth" + "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/config" + contextDb "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/contextdb" + "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/db" ) func main() { - rand.Seed(time.Now().UnixNano()) + rand.Seed(time.Now().UnixNano()) - err := db.InitializeDatabaseConnection("mco") - if err != nil { - log.Println("Unable to initialize database connection...") - log.Println(err) - log.Fatalln("Exiting...") - } + err := db.InitializeDatabaseConnection("mco") + if err != nil { + log.Println("Unable to initialize database connection...") + log.Println(err) + log.Fatalln("Exiting...") + } - err = contextDb.InitializeContextDatabase() - if err != nil { - log.Println("Unable to initialize database connection...") - log.Println(err) - log.Fatalln("Exiting...") - } + err = contextDb.InitializeContextDatabase() + if err != nil { + log.Println("Unable to initialize database connection...") + log.Println(err) + log.Fatalln("Exiting...") + } - httpRouter := api.NewRouter(nil, nil, nil, nil, nil) - loggedRouter := handlers.LoggingHandler(os.Stdout, httpRouter) - log.Println("Starting Distributed Cloud Manager API") + httpRouter := api.NewRouter(nil, nil, nil, nil, nil) + loggedRouter := handlers.LoggingHandler(os.Stdout, httpRouter) + log.Println("Starting Distributed Cloud Manager API") - httpServer := &http.Server{ - Handler: loggedRouter, - Addr: ":" + config.GetConfiguration().ServicePort, - } + httpServer := &http.Server{ + Handler: loggedRouter, + Addr: ":" + config.GetConfiguration().ServicePort, + } - connectionsClose := make(chan struct{}) - go func() { - c := make(chan os.Signal, 1) - signal.Notify(c, os.Interrupt) - <-c - httpServer.Shutdown(context.Background()) - close(connectionsClose) - }() + connectionsClose := make(chan struct{}) + go func() { + c := make(chan os.Signal, 1) + signal.Notify(c, os.Interrupt) + <-c + httpServer.Shutdown(context.Background()) + close(connectionsClose) + }() - tlsConfig, err := auth.GetTLSConfig("ca.cert", "server.cert", "server.key") - if err != nil { - log.Println("Error Getting TLS Configuration. Starting without TLS...") - log.Fatal(httpServer.ListenAndServe()) - } else { - httpServer.TLSConfig = tlsConfig + tlsConfig, err := auth.GetTLSConfig("ca.cert", "server.cert", "server.key") + if err != nil { + log.Println("Error Getting TLS Configuration. Starting without TLS...") + log.Fatal(httpServer.ListenAndServe()) + } else { + httpServer.TLSConfig = tlsConfig - err = httpServer.ListenAndServeTLS("", "") - } + err = httpServer.ListenAndServeTLS("", "") + } } -- cgit 1.2.3-korg