* 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 удалений

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

@@ -7,12 +7,12 @@ import (
"net/http"
"github.com/gorilla/mux"
_ "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/v5/app"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/services/configservice"
"github.com/mattermost/mattermost-server/v5/web"
_ "github.com/mattermost/go-i18n/i18n"
)
type Routes struct {

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

@@ -17,6 +17,10 @@ import (
"testing"
"time"
s3 "github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/app"
"github.com/mattermost/mattermost-server/v5/config"
"github.com/mattermost/mattermost-server/v5/mlog"
@@ -29,10 +33,6 @@ import (
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/mattermost/mattermost-server/v5/web"
"github.com/mattermost/mattermost-server/v5/wsapi"
s3 "github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
"github.com/stretchr/testify/require"
)
type TestHelper struct {

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

@@ -12,10 +12,11 @@ import (
"strings"
"testing"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
"github.com/mattermost/mattermost-server/v5/utils/testutils"
"github.com/stretchr/testify/require"
)
func TestCreateBot(t *testing.T) {

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

@@ -7,8 +7,9 @@ import (
"net/http"
"testing"
"github.com/mattermost/mattermost-server/v5/utils/testutils"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/utils/testutils"
)
func TestGetBrandImage(t *testing.T) {

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

@@ -6,9 +6,10 @@ package api4
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 TestCreateCategoryForTeamForUser(t *testing.T) {

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

@@ -12,12 +12,13 @@ import (
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin/plugintest/mock"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestCreateChannel(t *testing.T) {

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

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

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

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

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

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

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

@@ -8,6 +8,7 @@ import (
"strconv"
"github.com/avct/uasurfer"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/mattermost/mattermost-server/v5/model"
)

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

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

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

@@ -8,10 +8,11 @@ import (
"net/http"
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
)
const (

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

@@ -11,14 +11,13 @@ import (
"path/filepath"
"testing"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/app"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
)
func TestCreateEmoji(t *testing.T) {

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

@@ -19,12 +19,13 @@ import (
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/app"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
"github.com/mattermost/mattermost-server/v5/utils/testutils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
var testDir = ""

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

@@ -9,9 +9,10 @@ import (
"testing"
"time"
"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 TestGetGroup(t *testing.T) {

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

@@ -7,6 +7,7 @@ import (
"net/http"
"github.com/NYTimes/gziphandler"
"github.com/mattermost/mattermost-server/v5/web"
)

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

@@ -8,10 +8,10 @@ import (
"path/filepath"
"testing"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
"github.com/stretchr/testify/require"
)
func TestListImports(t *testing.T) {

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

@@ -12,9 +12,9 @@ import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/stretchr/testify/require"
)
type testHandler struct {

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

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

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

@@ -8,9 +8,10 @@ import (
"net/http"
"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 TestCreateOAuthApp(t *testing.T) {

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

@@ -18,15 +18,15 @@ import (
"testing"
"time"
svg "github.com/h2non/go-is-svg"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin"
"github.com/mattermost/mattermost-server/v5/testlib"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
svg "github.com/h2non/go-is-svg"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestPlugin(t *testing.T) {

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

@@ -7,9 +7,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 TestSaveReaction(t *testing.T) {

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

@@ -7,9 +7,9 @@ import (
"net/http"
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
)
func TestGetSamlMetadata(t *testing.T) {

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

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

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

@@ -14,10 +14,11 @@ import (
"testing"
"time"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
)
func TestGetPing(t *testing.T) {

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

@@ -7,11 +7,11 @@ import (
"net/http"
"strings"
"github.com/pkg/errors"
"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"
)
func (api *API) InitTeamLocal() {

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

@@ -12,13 +12,14 @@ import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/app"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/services/mailservice"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/mattermost/mattermost-server/v5/utils/testutils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestCreateTeam(t *testing.T) {

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

@@ -6,9 +6,10 @@ package api4
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 TestGetTermsOfService(t *testing.T) {

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

@@ -11,10 +11,10 @@ import (
"os"
"testing"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
"github.com/stretchr/testify/require"
)
func TestCreateUpload(t *testing.T) {

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

@@ -12,12 +12,13 @@ import (
"time"
"github.com/dgryski/dgoogauth"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/app"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/services/mailservice"
"github.com/mattermost/mattermost-server/v5/utils/testutils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestCreateUser(t *testing.T) {

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

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

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

@@ -7,6 +7,7 @@ import (
"net/http"
"github.com/gorilla/websocket"
"github.com/mattermost/mattermost-server/v5/model"
)