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

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

@@ -10,6 +10,8 @@ linters-settings:
govet:
check-shadowing: true
enable-all: true
goimports:
local-prefixes: github.com/mattermost/mattermost-server/v5
linters:
disable-all: true
@@ -27,6 +29,7 @@ linters:
- unused
- varcheck
- misspell
- goimports
# TODO: enable this later
# - errcheck
@@ -52,7 +55,7 @@ issues:
text: "should have|should be|should replace|stutters|underscore|annoying|error strings should not be capitalized"
- linters:
- golint
- golint
path: "model/"
- linters:

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

@@ -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"
)

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

@@ -8,12 +8,10 @@ import (
"fmt"
"io"
"io/ioutil"
"os"
"time"
"runtime/debug"
"net/http"
"os"
"runtime/debug"
"time"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"

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

@@ -14,6 +14,7 @@ import (
"github.com/mattermost/go-i18n/i18n"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/v5/einterfaces"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"

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

@@ -10,6 +10,7 @@ import (
"os/user"
"github.com/hashicorp/go-multierror"
"github.com/mattermost/mattermost-server/v5/audit"
"github.com/mattermost/mattermost-server/v5/config"
"github.com/mattermost/mattermost-server/v5/mlog"

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

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

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

@@ -5,14 +5,14 @@ package app
import (
"fmt"
"github.com/mattermost/mattermost-server/v5/plugin/plugintest/mock"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"testing"
"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"
)
func TestCheckIfRolesGrantPermission(t *testing.T) {

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

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

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

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

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

@@ -8,10 +8,9 @@ import (
"net/http"
"time"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)
func (a *App) createInitialSidebarCategories(userId, teamId string) *model.AppError {

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

@@ -5,7 +5,6 @@ package app
import (
"testing"
"time"
"github.com/mattermost/mattermost-server/v5/model"

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

@@ -14,6 +14,7 @@ import (
"unicode"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"

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

@@ -8,8 +8,9 @@ import (
"testing"
goi18n "github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/stretchr/testify/assert"
"github.com/mattermost/mattermost-server/v5/model"
)
func TestParseStaticListArgument(t *testing.T) {

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

@@ -10,10 +10,10 @@ import (
"net/url"
"time"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/pkg/errors"
)
const (

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

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

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

@@ -8,13 +8,12 @@ import (
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"path"
"strings"
"time"
"net/http"
"github.com/mattermost/go-i18n/i18n"
"github.com/pkg/errors"
"github.com/throttled/throttled"

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

@@ -6,17 +6,16 @@ package app
import (
"fmt"
"html/template"
"net/http"
"strconv"
"sync"
"time"
"github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils"
"net/http"
"github.com/mattermost/go-i18n/i18n"
)
const (

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

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

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

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

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

@@ -19,6 +19,7 @@ import (
"path"
"github.com/disintegration/imaging"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"

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

@@ -6,12 +6,13 @@ package app
import (
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/mattermost/mattermost-server/v5/einterfaces"
"github.com/mattermost/mattermost-server/v5/einterfaces/mocks"
"github.com/mattermost/mattermost-server/v5/model"
storemocks "github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
func TestSAMLSettings(t *testing.T) {

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

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

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

@@ -11,11 +11,11 @@ import (
"path/filepath"
"strings"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/store"
)
// We use this map to identify the exportable preferences.

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

@@ -11,8 +11,9 @@ import (
"path/filepath"
"strings"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/mlog"
)
// extractTarGz takes in an io.Reader containing the bytes for a .tar.gz file and

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

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

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

@@ -10,9 +10,10 @@ import (
"path/filepath"
"strings"
"sync"
"testing"
"time"
"testing"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/config"
"github.com/mattermost/mattermost-server/v5/mlog"
@@ -23,7 +24,6 @@ import (
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/mattermost/mattermost-server/v5/testlib"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/stretchr/testify/require"
)
type TestHelper struct {

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

@@ -14,7 +14,6 @@ import (
"sync"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
)

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

@@ -3,7 +3,9 @@
package app
import "github.com/mattermost/mattermost-server/v5/model"
import (
"github.com/mattermost/mattermost-server/v5/model"
)
// Import Data Models

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

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

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

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

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

@@ -11,11 +11,11 @@ import (
"time"
"github.com/dgrijalva/jwt-go"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/pkg/errors"
)
const (

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

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

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

@@ -14,6 +14,7 @@ import (
"time"
"github.com/avct/uasurfer"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin"

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

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

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

@@ -11,12 +11,13 @@ import (
"unicode"
"unicode/utf8"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/mattermost/mattermost-server/v5/utils/markdown"
"github.com/pkg/errors"
)
func (a *App) SendNotifications(post *model.Post, team *model.Team, channel *model.Channel, sender *model.User, parentPostList *model.PostList, setOnline bool) ([]string, error) {

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

@@ -14,6 +14,7 @@ import (
"time"
"github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils"

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

@@ -11,9 +11,9 @@ import (
"strings"
"sync"
"github.com/mattermost/go-i18n/i18n"
"github.com/pkg/errors"
"github.com/mattermost/go-i18n/i18n"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils"

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

@@ -11,14 +11,15 @@ import (
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/config"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/mattermost/mattermost-server/v5/testlib"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
)
func TestDoesNotifyPropsAllowPushNotification(t *testing.T) {

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

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

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

@@ -4,12 +4,12 @@
package app
import (
"github.com/stretchr/testify/require"
"strings"
"testing"
"github.com/dyatlov/go-opengraph/opengraph"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func BenchmarkForceHTMLEncodingToUTF8(b *testing.B) {

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

@@ -4,10 +4,10 @@
package app
import (
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/config"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
)

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

@@ -10,8 +10,9 @@ import (
"io"
"net/http"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
)
const permissionsExportBatchSize = 100

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

@@ -7,8 +7,9 @@ import (
"sort"
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/stretchr/testify/assert"
"github.com/mattermost/mattermost-server/v5/model"
)
func TestApplyPermissionsMap(t *testing.T) {

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

@@ -9,9 +9,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"
)
type testWriter struct {

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

@@ -16,16 +16,16 @@ import (
"strings"
"sync"
"github.com/blang/semver"
svg "github.com/h2non/go-is-svg"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin"
"github.com/mattermost/mattermost-server/v5/services/filesstore"
"github.com/mattermost/mattermost-server/v5/services/marketplace"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
"github.com/blang/semver"
svg "github.com/h2non/go-is-svg"
"github.com/pkg/errors"
)
const prepackagedPluginsDir = "prepackaged_plugins"

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

@@ -21,15 +21,15 @@ import (
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/einterfaces/mocks"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
)
func getDefaultPluginSettingsSchema() string {

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

@@ -7,10 +7,10 @@ import (
"bytes"
"net/http"
"github.com/gorilla/websocket"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin"
"github.com/gorilla/websocket"
)
type Plugin struct {

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

@@ -4,9 +4,10 @@
package main
import (
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin"
"github.com/pkg/errors"
)
type PluginUsingLogAPI struct {

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

@@ -9,8 +9,9 @@ import (
"net/url"
"strings"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
)
type PluginCommand struct {

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

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

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

@@ -3,7 +3,9 @@
package app
import "github.com/mattermost/mattermost-server/v5/plugin"
import (
"github.com/mattermost/mattermost-server/v5/plugin"
)
func (a *App) PluginContext() *plugin.Context {
context := &plugin.Context{

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

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

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

@@ -15,16 +15,15 @@ import (
"time"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/einterfaces/mocks"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin"
"github.com/mattermost/mattermost-server/v5/plugin/plugintest"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
)
func SetAppEnvironmentWithPlugins(t *testing.T, pluginCode []string, app *App, apiFunc func(*model.Manifest) plugin.API) (func(), []string, []error) {

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

@@ -13,11 +13,11 @@ import (
"sort"
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
)
type nilReadSeeker struct {

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

@@ -4,16 +4,16 @@
package app
import (
"bytes"
"fmt"
"io/ioutil"
"net/http"
"path"
"path/filepath"
"strings"
"bytes"
"io/ioutil"
"github.com/gorilla/mux"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/plugin"

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

@@ -10,12 +10,13 @@ import (
"net/http"
"path/filepath"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/pkg/errors"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/armor"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils"
)
// GetPluginPublicKeyFiles returns all public keys listed in the config.

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

@@ -9,11 +9,12 @@ import (
"path/filepath"
"testing"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
)
func TestPluginPublicKeys(t *testing.T) {

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

@@ -15,6 +15,7 @@ import (
"time"
"github.com/dyatlov/go-opengraph/opengraph"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/services/cache"

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

@@ -19,12 +19,13 @@ import (
"time"
"github.com/dyatlov/go-opengraph/opengraph"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/services/httpservice"
"github.com/mattermost/mattermost-server/v5/services/imageproxy"
"github.com/mattermost/mattermost-server/v5/utils/testutils"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestPreparePostListForClient(t *testing.T) {

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

@@ -11,15 +11,15 @@ import (
"strings"
"time"
"github.com/Masterminds/semver/v3"
"github.com/pkg/errors"
date_constraints "github.com/reflog/dateconstraints"
"github.com/mattermost/mattermost-server/v5/config"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/Masterminds/semver/v3"
"github.com/pkg/errors"
date_constraints "github.com/reflog/dateconstraints"
)
const MaxRepeatViewings = 3

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

@@ -12,9 +12,10 @@ import (
"testing"
"time"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store/storetest/mocks"
"github.com/stretchr/testify/require"
)
func TestNoticeValidation(t *testing.T) {

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

@@ -9,12 +9,13 @@ import (
"strconv"
"strings"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/pkg/errors"
"github.com/throttled/throttled"
"github.com/throttled/throttled/store/memstore"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils"
)
type RateLimiter struct {

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

@@ -9,8 +9,9 @@ import (
"strconv"
"testing"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
)
func genRateLimitSettings(useAuth, useIP bool, header string) *model.RateLimitSettings {

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

@@ -11,9 +11,10 @@ import (
"strings"
"testing"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/stretchr/testify/require"
)
type permissionInheritanceTestData struct {

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

@@ -28,7 +28,6 @@ import (
"github.com/gorilla/mux"
"github.com/pkg/errors"
"github.com/rs/cors"
"golang.org/x/crypto/acme/autocert"
"github.com/mattermost/mattermost-server/v5/audit"

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

@@ -3,7 +3,9 @@
package app
import "github.com/mattermost/mattermost-server/v5/model"
import (
"github.com/mattermost/mattermost-server/v5/model"
)
func (s *Server) License() *model.License {
license, _ := s.licenseValue.Load().(*model.License)

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

@@ -21,13 +21,13 @@ import (
"time"
"github.com/getsentry/sentry-go"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/stretchr/testify/require"
"github.com/mattermost/mattermost-server/v5/config"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-server/v5/store/storetest"
"github.com/mattermost/mattermost-server/v5/utils/fileutils"
"github.com/stretchr/testify/require"
)
func TestStartServerSuccess(t *testing.T) {

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

@@ -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 TestCache(t *testing.T) {

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

@@ -5,10 +5,9 @@ package app
import (
"bytes"
"fmt"
"mime/multipart"
"regexp"
"fmt"
"strings"
"github.com/mattermost/mattermost-server/v5/model"

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше