Skip to content
Snippets Groups Projects
Commit 1c3f162b authored by Andre Sterba's avatar Andre Sterba Committed by Manuel Kieweg
Browse files

Enable goimports linter

parent 3405158a
Branches
Tags
9 merge requests!246Develop,!245Develop into Master,!244Master into develop2 into master,!219Draft: Testing,!214Test pipelines,!195DO NOT MERGE 2,!194DO NOT MERGE! just for testing,!153Enable goimports linter,!138Develop
Showing
with 64 additions and 41 deletions
...@@ -26,8 +26,11 @@ linters: ...@@ -26,8 +26,11 @@ linters:
disable-all: true disable-all: true
enable: enable:
- gofmt - gofmt
- goimports
- golint - golint
- gocyclo - gocyclo
- govet - govet
issues: issues:
exclude-use-default: false exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0
\ No newline at end of file
package cli package cli
import ( import (
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/nucleus"
"context" "context"
"fmt" "fmt"
gpb "github.com/openconfig/gnmi/proto/gnmi"
"strings" "strings"
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/nucleus"
gpb "github.com/openconfig/gnmi/proto/gnmi"
) )
// Capabilities sends a gNMI Capabilities request to the specified target // Capabilities sends a gNMI Capabilities request to the specified target
......
package cli package cli
import ( import (
"context"
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi" "code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/nucleus" "code.fbi.h-da.de/cocsn/gosdn/nucleus"
"context"
gpb "github.com/openconfig/gnmi/proto/gnmi" gpb "github.com/openconfig/gnmi/proto/gnmi"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
) )
......
package cli package cli
import ( import (
"context"
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi" "code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/nucleus" "code.fbi.h-da.de/cocsn/gosdn/nucleus"
"context"
) )
// Set sends a gNMI Set request to the specified target. Only one // Set sends a gNMI Set request to the specified target. Only one
......
package cli package cli
import ( import (
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/nucleus"
"context" "context"
"fmt" "fmt"
gpb "github.com/openconfig/gnmi/proto/gnmi"
log "github.com/sirupsen/logrus"
"os" "os"
"os/signal" "os/signal"
"syscall" "syscall"
"time" "time"
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/nucleus"
gpb "github.com/openconfig/gnmi/proto/gnmi"
log "github.com/sirupsen/logrus"
) )
// Subscribe starts a gNMI subscriber requersting the specified paths on the target and // Subscribe starts a gNMI subscriber requersting the specified paths on the target and
......
package cli package cli
import ( import (
"context"
"net"
"reflect"
"code.fbi.h-da.de/cocsn/gosdn/forks/google/gnmi" "code.fbi.h-da.de/cocsn/gosdn/forks/google/gnmi"
oc "code.fbi.h-da.de/cocsn/yang-models/generated/openconfig" oc "code.fbi.h-da.de/cocsn/yang-models/generated/openconfig"
"context"
pb "github.com/openconfig/gnmi/proto/gnmi" pb "github.com/openconfig/gnmi/proto/gnmi"
"github.com/openconfig/goyang/pkg/yang" "github.com/openconfig/goyang/pkg/yang"
"github.com/openconfig/ygot/util" "github.com/openconfig/ygot/util"
...@@ -11,8 +14,6 @@ import ( ...@@ -11,8 +14,6 @@ import (
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"google.golang.org/grpc" "google.golang.org/grpc"
"google.golang.org/grpc/reflection" "google.golang.org/grpc/reflection"
"net"
"reflect"
) )
type server struct { type server struct {
......
...@@ -33,6 +33,7 @@ package cmd ...@@ -33,6 +33,7 @@ package cmd
import ( import (
"errors" "errors"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
......
...@@ -2,6 +2,7 @@ package database ...@@ -2,6 +2,7 @@ package database
import ( import (
"errors" "errors"
"github.com/neo4j/neo4j-go-driver/neo4j" "github.com/neo4j/neo4j-go-driver/neo4j"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/spf13/viper" "github.com/spf13/viper"
......
package nucleus package nucleus
import ( import (
"code.fbi.h-da.de/cocsn/gosdn/database"
"context" "context"
"github.com/google/uuid"
log "github.com/sirupsen/logrus"
"net/http" "net/http"
"os" "os"
"os/signal" "os/signal"
"sync" "sync"
"time" "time"
"code.fbi.h-da.de/cocsn/gosdn/database"
"github.com/google/uuid"
log "github.com/sirupsen/logrus"
) )
var coreLock sync.RWMutex var coreLock sync.RWMutex
......
package nucleus package nucleus
import ( import (
"reflect"
"testing"
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi" "code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/yang-models/generated/openconfig" "code.fbi.h-da.de/cocsn/yang-models/generated/openconfig"
"github.com/google/uuid" "github.com/google/uuid"
"github.com/openconfig/ygot/ygot" "github.com/openconfig/ygot/ygot"
"reflect"
"testing"
) )
func TestDevice_Id(t *testing.T) { func TestDevice_Id(t *testing.T) {
......
package nucleus package nucleus
import ( import (
"context"
"reflect"
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi" "code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
pathutils "code.fbi.h-da.de/cocsn/gosdn/nucleus/util/path" pathutils "code.fbi.h-da.de/cocsn/gosdn/nucleus/util/path"
"context"
gpb "github.com/openconfig/gnmi/proto/gnmi" gpb "github.com/openconfig/gnmi/proto/gnmi"
"github.com/openconfig/gnmi/proto/gnmi_ext" "github.com/openconfig/gnmi/proto/gnmi_ext"
"github.com/openconfig/goyang/pkg/yang" "github.com/openconfig/goyang/pkg/yang"
"github.com/openconfig/ygot/ygot" "github.com/openconfig/ygot/ygot"
"github.com/openconfig/ygot/ytypes" "github.com/openconfig/ygot/ytypes"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"reflect"
) )
// CtxKeyType is a custom type to be used as key in a context.WithValue() or // CtxKeyType is a custom type to be used as key in a context.WithValue() or
......
package nucleus package nucleus
import ( import (
"context"
"errors"
"reflect"
"testing"
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi" "code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/mocks" "code.fbi.h-da.de/cocsn/gosdn/mocks"
"code.fbi.h-da.de/cocsn/yang-models/generated/openconfig" "code.fbi.h-da.de/cocsn/yang-models/generated/openconfig"
"context"
"errors"
gpb "github.com/openconfig/gnmi/proto/gnmi" gpb "github.com/openconfig/gnmi/proto/gnmi"
"github.com/openconfig/gnmi/proto/gnmi_ext" "github.com/openconfig/gnmi/proto/gnmi_ext"
"github.com/openconfig/goyang/pkg/yang" "github.com/openconfig/goyang/pkg/yang"
"github.com/openconfig/ygot/ytypes" "github.com/openconfig/ygot/ytypes"
"github.com/stretchr/testify/mock" "github.com/stretchr/testify/mock"
"reflect"
"testing"
) )
// testSetupGnmi bootstraps tests for gnmi transport // testSetupGnmi bootstraps tests for gnmi transport
......
package nucleus package nucleus
import ( import (
"code.fbi.h-da.de/cocsn/gosdn/mocks"
"errors" "errors"
"net/http"
"testing"
"code.fbi.h-da.de/cocsn/gosdn/mocks"
"github.com/google/uuid" "github.com/google/uuid"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/mock" "github.com/stretchr/testify/mock"
"net/http"
"testing"
) )
func testSetupHTTP() { func testSetupHTTP() {
......
package nucleus package nucleus
import ( import (
"context"
"os"
"testing"
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi" "code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
"code.fbi.h-da.de/cocsn/gosdn/mocks" "code.fbi.h-da.de/cocsn/gosdn/mocks"
"code.fbi.h-da.de/cocsn/gosdn/nucleus/util/proto" "code.fbi.h-da.de/cocsn/gosdn/nucleus/util/proto"
"code.fbi.h-da.de/cocsn/gosdn/test" "code.fbi.h-da.de/cocsn/gosdn/test"
"context"
"github.com/google/uuid" "github.com/google/uuid"
gpb "github.com/openconfig/gnmi/proto/gnmi" gpb "github.com/openconfig/gnmi/proto/gnmi"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"github.com/stretchr/testify/mock" "github.com/stretchr/testify/mock"
pb "google.golang.org/protobuf/proto" pb "google.golang.org/protobuf/proto"
"os"
"testing"
) )
const apiEndpoint = "http://localhost:8080" const apiEndpoint = "http://localhost:8080"
......
...@@ -2,13 +2,14 @@ package pnd ...@@ -2,13 +2,14 @@ package pnd
import ( import (
"errors" "errors"
"os"
"sync"
"time"
"github.com/google/uuid" "github.com/google/uuid"
"github.com/openconfig/ygot/ygot" "github.com/openconfig/ygot/ygot"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"golang.org/x/net/context" "golang.org/x/net/context"
"os"
"sync"
"time"
) )
var changeTimeout time.Duration var changeTimeout time.Duration
......
...@@ -3,13 +3,14 @@ package pnd ...@@ -3,13 +3,14 @@ package pnd
import ( import (
"context" "context"
"errors" "errors"
"github.com/google/uuid"
"github.com/openconfig/ygot/exampleoc"
"github.com/openconfig/ygot/ygot"
"reflect" "reflect"
"sync" "sync"
"testing" "testing"
"time" "time"
"github.com/google/uuid"
"github.com/openconfig/ygot/exampleoc"
"github.com/openconfig/ygot/ygot"
) )
var commit = "commit" var commit = "commit"
......
package pnd package pnd
import ( import (
"github.com/google/uuid"
log "github.com/sirupsen/logrus"
"os" "os"
"testing" "testing"
"github.com/google/uuid"
log "github.com/sirupsen/logrus"
) )
// UUIDs for test cases // UUIDs for test cases
......
package nucleus package nucleus
import ( import (
"context"
"code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi" "code.fbi.h-da.de/cocsn/gosdn/forks/goarista/gnmi"
. "code.fbi.h-da.de/cocsn/gosdn/nucleus/pnd" //nolint . "code.fbi.h-da.de/cocsn/gosdn/nucleus/pnd" //nolint
"context"
"github.com/openconfig/ygot/ygot" "github.com/openconfig/ygot/ygot"
"github.com/openconfig/ygot/ytypes" "github.com/openconfig/ygot/ytypes"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"encoding/json" "encoding/json"
"github.com/google/uuid" "github.com/google/uuid"
) )
......
package nucleus package nucleus
import ( import (
"errors"
"reflect"
"testing"
"code.fbi.h-da.de/cocsn/gosdn/mocks" "code.fbi.h-da.de/cocsn/gosdn/mocks"
"code.fbi.h-da.de/cocsn/yang-models/generated/openconfig" "code.fbi.h-da.de/cocsn/yang-models/generated/openconfig"
"errors"
"github.com/google/uuid" "github.com/google/uuid"
"github.com/openconfig/ygot/ygot" "github.com/openconfig/ygot/ygot"
"github.com/stretchr/testify/mock" "github.com/stretchr/testify/mock"
"reflect"
"testing"
) )
func TestNewPND(t *testing.T) { func TestNewPND(t *testing.T) {
......
...@@ -2,6 +2,7 @@ package nucleus ...@@ -2,6 +2,7 @@ package nucleus
import ( import (
"context" "context"
"github.com/openconfig/ygot/ytypes" "github.com/openconfig/ygot/ytypes"
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment