Fix initialism errors (PR-2) (#17032)
* Fix initialism errors * Fix check-mocks test * Revert mlog and filestore packages * Update plugin_hooks_test.go * Update opentracinglayer.go * Regenerate mocks and check store layers * Revert plugin's context changes * Update context.go * Update plugin_requests.go * Update plugin_hooks_test.go * Regenerate mocks * Regenerate mocks and store layers Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
db01f2a91b
Коммит
343c51830f
@@ -854,7 +854,7 @@ type simple struct {
|
||||
I int
|
||||
f float64
|
||||
fp *float64
|
||||
Ip *int
|
||||
IP *int
|
||||
B *bool
|
||||
Sli []int
|
||||
Msi map[string]int
|
||||
@@ -981,8 +981,8 @@ func TestMergeWithSimpleStruct(t *testing.T) {
|
||||
assert.NotEqual(t, *t1.S2.S, *t2.S2.S)
|
||||
|
||||
// changes in merged (on pointers that were cloned from base or patch) do not affect base or patch
|
||||
*merged.Ip = 0
|
||||
assert.Equal(t, 99, *t1.Ip)
|
||||
*merged.IP = 0
|
||||
assert.Equal(t, 99, *t1.IP)
|
||||
*merged.S2.S = "testMERGED"
|
||||
assert.NotEqual(t, *t2.S2.S, *merged.S2.S)
|
||||
})
|
||||
@@ -1096,7 +1096,7 @@ func TestMergeWithVeryComplexStruct(t *testing.T) {
|
||||
|
||||
base.F = 1342.12
|
||||
base.Struct1.Pi = newInt(937)
|
||||
base.Struct1p.Ui = 734
|
||||
base.Struct1p.UI = 734
|
||||
base.Struct1.Struct2.Sli = []int{123123, 1243123}
|
||||
|
||||
merged, err := mergeTestStructs(base, patch)
|
||||
@@ -1203,11 +1203,11 @@ type testStruct struct {
|
||||
F float64
|
||||
F32 float32
|
||||
S string
|
||||
Ui uint
|
||||
Ui8 uint8
|
||||
Ui16 uint32
|
||||
Ui32 uint32
|
||||
Ui64 uint64
|
||||
UI uint
|
||||
UI8 uint8
|
||||
UI16 uint32
|
||||
UI32 uint32
|
||||
UI64 uint64
|
||||
Pi *int
|
||||
Pi8 *int8
|
||||
Pi16 *int16
|
||||
@@ -1241,11 +1241,11 @@ type testStructEmbed struct {
|
||||
F float64
|
||||
F32 float32
|
||||
S string
|
||||
Ui uint
|
||||
Ui8 uint8
|
||||
Ui16 uint32
|
||||
Ui32 uint32
|
||||
Ui64 uint64
|
||||
UI uint
|
||||
UI8 uint8
|
||||
UI16 uint32
|
||||
UI32 uint32
|
||||
UI64 uint64
|
||||
Pi *int
|
||||
Pi8 *int8
|
||||
Pi16 *int16
|
||||
@@ -1279,11 +1279,11 @@ type testStructEmbed2 struct {
|
||||
F float64
|
||||
F32 float32
|
||||
S string
|
||||
Ui uint
|
||||
Ui8 uint8
|
||||
Ui16 uint32
|
||||
Ui32 uint32
|
||||
Ui64 uint64
|
||||
UI uint
|
||||
UI8 uint8
|
||||
UI16 uint32
|
||||
UI32 uint32
|
||||
UI64 uint64
|
||||
Pi *int
|
||||
Pi8 *int8
|
||||
Pi16 *int16
|
||||
|
||||
@@ -106,12 +106,12 @@ func TestUpdateAssetsSubpath(t *testing.T) {
|
||||
},
|
||||
{
|
||||
"content security policy not found (missing quotes)",
|
||||
contentSecurityPolicyNotFoundHtml,
|
||||
contentSecurityPolicyNotFoundHTML,
|
||||
baseCss,
|
||||
baseManifestJSON,
|
||||
"/subpath",
|
||||
fmt.Errorf("failed to find 'Content-Security-Policy' meta tag to rewrite"),
|
||||
contentSecurityPolicyNotFoundHtml,
|
||||
contentSecurityPolicyNotFoundHTML,
|
||||
baseCss,
|
||||
baseManifestJSON,
|
||||
},
|
||||
@@ -135,18 +135,18 @@ func TestUpdateAssetsSubpath(t *testing.T) {
|
||||
nil,
|
||||
subpathRootHtml,
|
||||
subpathCSS,
|
||||
subpathManifestJson,
|
||||
subpathManifestJSON,
|
||||
},
|
||||
{
|
||||
"new subpath from old",
|
||||
subpathRootHtml,
|
||||
subpathCSS,
|
||||
subpathManifestJson,
|
||||
subpathManifestJSON,
|
||||
"/nested/subpath",
|
||||
nil,
|
||||
newSubpathRootHTML,
|
||||
newSubpathCSS,
|
||||
newSubpathManifestJson,
|
||||
newSubpathManifestJSON,
|
||||
},
|
||||
{
|
||||
"resetting to /",
|
||||
@@ -268,7 +268,7 @@ func sToP(s string) *string {
|
||||
return &s
|
||||
}
|
||||
|
||||
const contentSecurityPolicyNotFoundHtml = `<!DOCTYPE html> <html lang=en> <head> <meta charset=utf-8> <meta http-equiv=Content-Security-Policy content="script-src 'self' cdn.rudderlabs.com/ js.stripe.com/v3"> <meta http-equiv=X-UA-Compatible content="IE=edge"> <meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"> <meta name=robots content="noindex, nofollow"> <meta name=referrer content=no-referrer> <title>Mattermost</title> <meta name=apple-mobile-web-app-capable content=yes> <meta name=apple-mobile-web-app-status-bar-style content=default> <meta name=mobile-web-app-capable content=yes> <meta name=apple-mobile-web-app-title content=Mattermost> <meta name=application-name content=Mattermost> <meta name=format-detection content="telephone=no"> <link rel=apple-touch-icon sizes=57x57 href=/static/files/78b7e73b41b8731ce2c41c870ecc8886.png> <link rel=apple-touch-icon sizes=60x60 href=/static/files/51d00ffd13afb6d74fd8f6dfdeef768a.png> <link rel=apple-touch-icon sizes=72x72 href=/static/files/23645596f8f78f017bd4d457abb855c4.png> <link rel=apple-touch-icon sizes=76x76 href=/static/files/26e9d72f472663a00b4b206149459fab.png> <link rel=apple-touch-icon sizes=144x144 href=/static/files/7bd91659bf3fc8c68fcd45fc1db9c630.png> <link rel=apple-touch-icon sizes=120x120 href=/static/files/fa69ffe11eb334aaef5aece8d848ca62.png> <link rel=apple-touch-icon sizes=152x152 href=/static/files/f046777feb6ab12fc43b8f9908b1db35.png> <link rel=icon type=image/png sizes=16x16 href=/static/files/02b96247d275680adaaabf01c71c571d.png> <link rel=icon type=image/png sizes=32x32 href=/static/files/1d9020f201a6762421cab8d30624fdd8.png> <link rel=icon type=image/png sizes=96x96 href=/static/files/fe23af39ae98d77dc26ae8586565970f.png> <link rel=icon type=image/png sizes=192x192 href=/static/files/d7ff68a7675f84337cc154c3d4abe713.png> <link rel=manifest href=/static/files/a985ad72552ad069537d6eea81e719c7.json> <link rel=stylesheet class=code_theme> <style>.error-screen{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding-top:50px;max-width:750px;font-size:14px;color:#333;margin:auto;display:none;line-height:1.5}.error-screen h2{font-size:30px;font-weight:400;line-height:1.2}.error-screen ul{padding-left:15px;line-height:1.7;margin-top:0;margin-bottom:10px}.error-screen hr{color:#ddd;margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.error-screen-visible{display:block}</style> <link href="/static/main.364fd054d7a6d741efc6.css" rel="stylesheet"><script type="text/javascript" src="/static/main.e49599ac425584ffead5.js"></script></head> <body class=font--open_sans> <div id=root> <div class=error-screen> <h2>Cannot connect to Mattermost</h2> <hr/> <p>We're having trouble connecting to Mattermost. If refreshing this page (Ctrl+R or Command+R) does not work, please verify that your computer is connected to the internet.</p> <br/> </div> <div class=loading-screen style=position:relative> <div class=loading__content> <div class="round round-1"></div> <div class="round round-2"></div> <div class="round round-3"></div> </div> </div> </div> <noscript> To use Mattermost, please enable JavaScript. </noscript> </body> </html>`
|
||||
const contentSecurityPolicyNotFoundHTML = `<!DOCTYPE html> <html lang=en> <head> <meta charset=utf-8> <meta http-equiv=Content-Security-Policy content="script-src 'self' cdn.rudderlabs.com/ js.stripe.com/v3"> <meta http-equiv=X-UA-Compatible content="IE=edge"> <meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"> <meta name=robots content="noindex, nofollow"> <meta name=referrer content=no-referrer> <title>Mattermost</title> <meta name=apple-mobile-web-app-capable content=yes> <meta name=apple-mobile-web-app-status-bar-style content=default> <meta name=mobile-web-app-capable content=yes> <meta name=apple-mobile-web-app-title content=Mattermost> <meta name=application-name content=Mattermost> <meta name=format-detection content="telephone=no"> <link rel=apple-touch-icon sizes=57x57 href=/static/files/78b7e73b41b8731ce2c41c870ecc8886.png> <link rel=apple-touch-icon sizes=60x60 href=/static/files/51d00ffd13afb6d74fd8f6dfdeef768a.png> <link rel=apple-touch-icon sizes=72x72 href=/static/files/23645596f8f78f017bd4d457abb855c4.png> <link rel=apple-touch-icon sizes=76x76 href=/static/files/26e9d72f472663a00b4b206149459fab.png> <link rel=apple-touch-icon sizes=144x144 href=/static/files/7bd91659bf3fc8c68fcd45fc1db9c630.png> <link rel=apple-touch-icon sizes=120x120 href=/static/files/fa69ffe11eb334aaef5aece8d848ca62.png> <link rel=apple-touch-icon sizes=152x152 href=/static/files/f046777feb6ab12fc43b8f9908b1db35.png> <link rel=icon type=image/png sizes=16x16 href=/static/files/02b96247d275680adaaabf01c71c571d.png> <link rel=icon type=image/png sizes=32x32 href=/static/files/1d9020f201a6762421cab8d30624fdd8.png> <link rel=icon type=image/png sizes=96x96 href=/static/files/fe23af39ae98d77dc26ae8586565970f.png> <link rel=icon type=image/png sizes=192x192 href=/static/files/d7ff68a7675f84337cc154c3d4abe713.png> <link rel=manifest href=/static/files/a985ad72552ad069537d6eea81e719c7.json> <link rel=stylesheet class=code_theme> <style>.error-screen{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding-top:50px;max-width:750px;font-size:14px;color:#333;margin:auto;display:none;line-height:1.5}.error-screen h2{font-size:30px;font-weight:400;line-height:1.2}.error-screen ul{padding-left:15px;line-height:1.7;margin-top:0;margin-bottom:10px}.error-screen hr{color:#ddd;margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.error-screen-visible{display:block}</style> <link href="/static/main.364fd054d7a6d741efc6.css" rel="stylesheet"><script type="text/javascript" src="/static/main.e49599ac425584ffead5.js"></script></head> <body class=font--open_sans> <div id=root> <div class=error-screen> <h2>Cannot connect to Mattermost</h2> <hr/> <p>We're having trouble connecting to Mattermost. If refreshing this page (Ctrl+R or Command+R) does not work, please verify that your computer is connected to the internet.</p> <br/> </div> <div class=loading-screen style=position:relative> <div class=loading__content> <div class="round round-1"></div> <div class="round round-2"></div> <div class="round round-3"></div> </div> </div> </div> <noscript> To use Mattermost, please enable JavaScript. </noscript> </body> </html>`
|
||||
|
||||
const contentSecurityPolicyNotFound2Html = `<!DOCTYPE html> <html lang=en> <head> <meta charset=utf-8> <meta http-equiv=Content-Security-Policy content="script-src 'self' cdn.rudderlabs.com/ js.stripe.com/v3 'unsafe-eval'"> <meta http-equiv=X-UA-Compatible content="IE=edge"> <meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"> <meta name=robots content="noindex, nofollow"> <meta name=referrer content=no-referrer> <title>Mattermost</title> <meta name=apple-mobile-web-app-capable content=yes> <meta name=apple-mobile-web-app-status-bar-style content=default> <meta name=mobile-web-app-capable content=yes> <meta name=apple-mobile-web-app-title content=Mattermost> <meta name=application-name content=Mattermost> <meta name=format-detection content="telephone=no"> <link rel=apple-touch-icon sizes=57x57 href=/static/files/78b7e73b41b8731ce2c41c870ecc8886.png> <link rel=apple-touch-icon sizes=60x60 href=/static/files/51d00ffd13afb6d74fd8f6dfdeef768a.png> <link rel=apple-touch-icon sizes=72x72 href=/static/files/23645596f8f78f017bd4d457abb855c4.png> <link rel=apple-touch-icon sizes=76x76 href=/static/files/26e9d72f472663a00b4b206149459fab.png> <link rel=apple-touch-icon sizes=144x144 href=/static/files/7bd91659bf3fc8c68fcd45fc1db9c630.png> <link rel=apple-touch-icon sizes=120x120 href=/static/files/fa69ffe11eb334aaef5aece8d848ca62.png> <link rel=apple-touch-icon sizes=152x152 href=/static/files/f046777feb6ab12fc43b8f9908b1db35.png> <link rel=icon type=image/png sizes=16x16 href=/static/files/02b96247d275680adaaabf01c71c571d.png> <link rel=icon type=image/png sizes=32x32 href=/static/files/1d9020f201a6762421cab8d30624fdd8.png> <link rel=icon type=image/png sizes=96x96 href=/static/files/fe23af39ae98d77dc26ae8586565970f.png> <link rel=icon type=image/png sizes=192x192 href=/static/files/d7ff68a7675f84337cc154c3d4abe713.png> <link rel=manifest href=/static/files/a985ad72552ad069537d6eea81e719c7.json> <link rel=stylesheet class=code_theme> <style>.error-screen{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;padding-top:50px;max-width:750px;font-size:14px;color:#333;margin:auto;display:none;line-height:1.5}.error-screen h2{font-size:30px;font-weight:400;line-height:1.2}.error-screen ul{padding-left:15px;line-height:1.7;margin-top:0;margin-bottom:10px}.error-screen hr{color:#ddd;margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.error-screen-visible{display:block}</style> <link href="/static/main.364fd054d7a6d741efc6.css" rel="stylesheet"><script type="text/javascript" src="/static/main.e49599ac425584ffead5.js"></script></head> <body class=font--open_sans> <div id=root> <div class=error-screen> <h2>Cannot connect to Mattermost</h2> <hr/> <p>We're having trouble connecting to Mattermost. If refreshing this page (Ctrl+R or Command+R) does not work, please verify that your computer is connected to the internet.</p> <br/> </div> <div class=loading-screen style=position:relative> <div class=loading__content> <div class="round round-1"></div> <div class="round round-2"></div> <div class="round round-3"></div> </div> </div> </div> <noscript> To use Mattermost, please enable JavaScript. </noscript> </body> </html>`
|
||||
|
||||
@@ -352,7 +352,7 @@ const baseManifestJSON = `{
|
||||
}
|
||||
`
|
||||
|
||||
const subpathManifestJson = `{
|
||||
const subpathManifestJSON = `{
|
||||
"icons": [
|
||||
{
|
||||
"src": "/subpath/static/icon_96x96.png",
|
||||
@@ -420,7 +420,7 @@ const subpathManifestJson = `{
|
||||
}
|
||||
`
|
||||
|
||||
const newSubpathManifestJson = `{
|
||||
const newSubpathManifestJSON = `{
|
||||
"icons": [
|
||||
{
|
||||
"src": "/nested/subpath/static/icon_96x96.png",
|
||||
|
||||
@@ -177,8 +177,8 @@ func GetURLWithCache(url string, cache *RequestCache, skip bool) ([]byte, error)
|
||||
}
|
||||
|
||||
// Append tokens to passed baseUrl as query params
|
||||
func AppendQueryParamsToURL(baseUrl string, params map[string]string) string {
|
||||
u, err := url.Parse(baseUrl)
|
||||
func AppendQueryParamsToURL(baseURL string, params map[string]string) string {
|
||||
u, err := url.Parse(baseURL)
|
||||
if err != nil {
|
||||
return ""
|
||||
}
|
||||
|
||||
@@ -163,10 +163,10 @@ func TestRemoveStringFromSlice(t *testing.T) {
|
||||
|
||||
func TestAppendQueryParamsToURL(t *testing.T) {
|
||||
url := "mattermost://callback"
|
||||
redirectUrl := AppendQueryParamsToURL(url, map[string]string{
|
||||
redirectURL := AppendQueryParamsToURL(url, map[string]string{
|
||||
"key1": "value1",
|
||||
"key2": "value2",
|
||||
})
|
||||
expected := url + "?key1=value1&key2=value2"
|
||||
assert.Equal(t, redirectUrl, expected)
|
||||
assert.Equal(t, redirectURL, expected)
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user