diff --git a/.golangci.yml b/.golangci.yml index e0a2c7a88e52c3c4186169f9b789ec95a44cca4a..367a0ae213d047f00335f7af257c949bc4b88394 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -9,7 +9,7 @@ linters-settings: linters: disable-all: true enable: - - goimports + - gofmt - golint - gocyclo - govet diff --git a/database/database.go b/database/database.go index e761b779dc8400fca30ffba527eac536fa524a42..3333d55299136190301cb9447343e6c3bae1f2e4 100644 --- a/database/database.go +++ b/database/database.go @@ -105,7 +105,7 @@ func (d Database) StoreNodeEdgePoints(json string) { } -func (d Database) StoreConnections(json string){} +func (d Database) StoreConnections(json string) {} //setNodeNodeEdgePointsRelation creates the database relations between "nodes" and "node edge points" func setNodeNodeEdgePointsRelation(session neo4j.Session) { diff --git a/gosdn-cli/gosdn-cli.go b/gosdn-cli/gosdn-cli.go index da4cf175013b2ca484a6a57fe84fdb8e0a14df03..d6bcc5e34b53cda19f5eba46ec3e5414f25ff8a5 100644 --- a/gosdn-cli/gosdn-cli.go +++ b/gosdn-cli/gosdn-cli.go @@ -3,13 +3,13 @@ package main import ( pb "code.fbi.h-da.de/cocsn/gosdn/cliInterface" "context" + "flag" "fmt" "github.com/rivo/tview" "google.golang.org/grpc" "log" "os" "time" - "flag" ) const ( @@ -29,27 +29,27 @@ var ( type cliClientConfig struct { goSDNCLIAddr4 *string goSDNCLIPort4 *int - interactive *bool - goSDNCommand *string + interactive *bool + goSDNCommand *string } type commandOptions struct { - name string + name string description string - command func(conn *grpc.ClientConn) () + command func(conn *grpc.ClientConn) } -var commandList = map[string] commandOptions { - "hello": {"hello", "test connection to goSDN controller", goSDNSayHello}, +var commandList = map[string]commandOptions{ + "hello": {"hello", "test connection to goSDN controller", goSDNSayHello}, "shutdown": {"shutdown", "request goSDN controller to shutdown", goSDNShutdown}, - "testdb" : {"testdb", "test all database connections", goSDNTestDB}, + "testdb": {"testdb", "test all database connections", goSDNTestDB}, } /* gosdn-cli allows to mode of operations: - interactive: text GUI to operate goSDN - non-interactive: basic CLI without text GUI - */ +*/ func main() { // This holds the basic configuration for gosdn-cli @@ -64,7 +64,7 @@ func main() { flag.Parse() // Print complete command list and exit - if (*printCommandList == true) { + if *printCommandList == true { for _, element := range commandList { fmt.Println(element.name + "\t" + element.description) } @@ -87,11 +87,11 @@ func main() { log.Println(("Connected to " + conn.Target())) // Check for non-interactive or interactive mode - if(*myConfiguration.interactive == false) { + if *myConfiguration.interactive == false { log.Println("starting in non-interactive mode") // Lookup command or die _, found := commandList[*myConfiguration.goSDNCommand] - if(found) { + if found { // Excecute desired command commandList[*myConfiguration.goSDNCommand].command(conn) } else { @@ -118,8 +118,7 @@ func main() { } } - -func goSDNSayHello (conn *grpc.ClientConn) { +func goSDNSayHello(conn *grpc.ClientConn) { c := pb.NewGreeterClient(conn) @@ -136,10 +135,9 @@ func goSDNSayHello (conn *grpc.ClientConn) { } log.Printf("Greeting: %s", r.GetMessage()) - } -func goSDNShutdown (conn *grpc.ClientConn) { +func goSDNShutdown(conn *grpc.ClientConn) { c := pb.NewGreeterClient(conn) @@ -157,6 +155,6 @@ func goSDNShutdown (conn *grpc.ClientConn) { log.Printf("Greeting: %s", r.GetMessage()) } -func goSDNTestDB(conn *grpc.ClientConn){ +func goSDNTestDB(conn *grpc.ClientConn) { // TODO: fill with code -} \ No newline at end of file +} diff --git a/restconf/util/unmarshal.go b/restconf/util/unmarshal.go index b044bd09ceb2385a7087850ed2c322db8ce4634c..63437e6b232deffb3954e1f68c260ef9f4dfd3fe 100644 --- a/restconf/util/unmarshal.go +++ b/restconf/util/unmarshal.go @@ -9,7 +9,7 @@ type YANGConsumer struct { Data *[]byte } -func (yc YANGConsumer)Consume(reader io.Reader, _ interface{}) error { +func (yc YANGConsumer) Consume(reader io.Reader, _ interface{}) error { var err error = nil *yc.Data, err = ioutil.ReadAll(reader) return err