* format using `goimports -local github.com/mattermost/mattermost-server/v5 -w`

* added goimports lint check to .golangci.yml

* format using `goimports -local github.com/mattermost/mattermost-server/v5 -w` for a corner case

* make app-layers, *-mocks and store-layers for ci check

Co-authored-by: Mahmudul Haque <mahmudulhaque@protonmail.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Agniva De Sarker
2021-01-07 22:42:43 +05:30
коммит произвёл GitHub
родитель 0c2c31bb0a
Коммит e89b26e8f3
337 изменённых файлов: 728 добавлений и 508 удалений

Просмотреть файл

@@ -6,11 +6,12 @@ package commands
import (
"fmt"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/app"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
var ChannelCmd = &cobra.Command{

Просмотреть файл

@@ -8,9 +8,10 @@ import (
"strings"
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
)
func TestJoinChannel(t *testing.T) {

Просмотреть файл

@@ -5,14 +5,14 @@ package commands
import (
"errors"
"fmt"
"strings"
"fmt"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/app"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/spf13/cobra"
)
var CommandCmd = &cobra.Command{

Просмотреть файл

@@ -6,9 +6,10 @@ package commands
import (
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
)
func TestCreateCommand(t *testing.T) {

Просмотреть файл

@@ -6,11 +6,11 @@ package commands
import (
"fmt"
"github.com/mattermost/mattermost-server/v5/config"
"github.com/mattermost/mattermost-server/v5/store/sqlstore"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/config"
"github.com/mattermost/mattermost-server/v5/store/sqlstore"
)
var DbCmd = &cobra.Command{

Просмотреть файл

@@ -9,10 +9,11 @@ import (
"os"
"time"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/mattermost/mattermost-server/v5/model"
)
var ExportCmd = &cobra.Command{

Просмотреть файл

@@ -6,11 +6,11 @@ package commands
import (
"fmt"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/mattermost/mattermost-server/v5/model"
)
var GroupCmd = &cobra.Command{

Просмотреть файл

@@ -6,8 +6,9 @@ package commands
import (
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
)
func TestChannelGroupEnable(t *testing.T) {

Просмотреть файл

@@ -5,12 +5,12 @@ package commands
import (
"errors"
"fmt"
"os"
"fmt"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/spf13/cobra"
)
var ImportCmd = &cobra.Command{

Просмотреть файл

@@ -4,11 +4,12 @@
package commands
import (
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/app"
"github.com/mattermost/mattermost-server/v5/config"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/spf13/cobra"
)
func InitDBCommandContextCobra(command *cobra.Command) (*app.App, error) {

Просмотреть файл

@@ -8,8 +8,9 @@ import (
"os"
"strings"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/model"
)
var IntegrityCmd = &cobra.Command{

Просмотреть файл

@@ -8,10 +8,11 @@ import (
"os/signal"
"syscall"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/mattermost/mattermost-server/v5/config"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/spf13/cobra"
)
var JobserverCmd = &cobra.Command{

Просмотреть файл

@@ -4,9 +4,10 @@
package commands
import (
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/spf13/cobra"
)
var LdapCmd = &cobra.Command{

Просмотреть файл

@@ -7,8 +7,9 @@ import (
"errors"
"io/ioutil"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/audit"
)
var LicenseCmd = &cobra.Command{

Просмотреть файл

@@ -7,8 +7,9 @@ import (
"io"
"os"
"github.com/mattermost/mattermost-server/v5/mlog/human"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/mlog/human"
)
var LogsCmd = &cobra.Command{

Просмотреть файл

@@ -8,10 +8,11 @@ import (
"os"
"path/filepath"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/mattermost/mattermost-server/v5/model"
)
var PluginCmd = &cobra.Command{

Просмотреть файл

@@ -7,10 +7,11 @@ import (
"path/filepath"
"testing"
"github.com/mattermost/mattermost-server/v5/config"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/config"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
)
func TestPlugin(t *testing.T) {

Просмотреть файл

@@ -7,8 +7,9 @@ import (
"errors"
"fmt"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/audit"
)
var ResetCmd = &cobra.Command{

Просмотреть файл

@@ -16,11 +16,12 @@ import (
"time"
"github.com/icrowley/fake"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/app"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/spf13/cobra"
)
const (

Просмотреть файл

@@ -10,6 +10,9 @@ import (
"runtime/debug"
"syscall"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/api4"
"github.com/mattermost/mattermost-server/v5/app"
"github.com/mattermost/mattermost-server/v5/config"
@@ -18,8 +21,6 @@ import (
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/mattermost/mattermost-server/v5/web"
"github.com/mattermost/mattermost-server/v5/wsapi"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
var serverCmd = &cobra.Command{

Просмотреть файл

@@ -10,9 +10,10 @@ import (
"syscall"
"testing"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/config"
"github.com/mattermost/mattermost-server/v5/jobs"
"github.com/stretchr/testify/require"
)
const (

Просмотреть файл

@@ -9,10 +9,11 @@ import (
"sort"
"strings"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/app"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/spf13/cobra"
)
var TeamCmd = &cobra.Command{

Просмотреть файл

@@ -6,9 +6,10 @@ package commands
import (
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
)
func TestCreateTeam(t *testing.T) {

Просмотреть файл

@@ -8,15 +8,15 @@ import (
"fmt"
"os"
"os/exec"
"os/signal"
"syscall"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/api4"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/mattermost/mattermost-server/v5/wsapi"
"github.com/spf13/cobra"
)
var TestCmd = &cobra.Command{

Просмотреть файл

@@ -10,10 +10,11 @@ import (
"io/ioutil"
"strings"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/app"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/spf13/cobra"
)
var UserCmd = &cobra.Command{

Просмотреть файл

@@ -6,8 +6,9 @@ package commands
import (
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
)
func TestCreateUserWithTeam(t *testing.T) {

Просмотреть файл

@@ -12,9 +12,10 @@ import (
"sort"
"strings"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/spf13/cobra"
)
const CustomDefaultsEnvVar = "MM_CUSTOM_DEFAULTS_PATH"

Просмотреть файл

@@ -4,9 +4,10 @@
package commands
import (
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/app"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/spf13/cobra"
)
var VersionCmd = &cobra.Command{

Просмотреть файл

@@ -8,11 +8,12 @@ import (
"net/http"
"strings"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/pkg/errors"
"github.com/spf13/cobra"
)
var WebhookCmd = &cobra.Command{

Просмотреть файл

@@ -9,7 +9,6 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/api4"

Просмотреть файл

@@ -6,17 +6,6 @@ package main
import (
"os"
"github.com/mattermost/mattermost-server/v5/cmd/mattermost/commands"
// Import and register app layer slash commands
_ "github.com/mattermost/mattermost-server/v5/app/slashcommands"
// Plugins
_ "github.com/mattermost/mattermost-server/v5/model/gitlab"
// Enterprise Imports
_ "github.com/mattermost/mattermost-server/v5/imports"
// Enterprise Deps
_ "github.com/gorilla/handlers"
_ "github.com/hako/durafmt"
@@ -28,6 +17,14 @@ import (
_ "github.com/prometheus/client_golang/prometheus/promhttp"
_ "github.com/tylerb/graceful"
_ "gopkg.in/olivere/elastic.v6"
"github.com/mattermost/mattermost-server/v5/cmd/mattermost/commands"
// Import and register app layer slash commands
_ "github.com/mattermost/mattermost-server/v5/app/slashcommands"
// Plugins
_ "github.com/mattermost/mattermost-server/v5/model/gitlab"
// Enterprise Imports
_ "github.com/mattermost/mattermost-server/v5/imports"
)
func main() {