Prohibit variable shadowing (#10177)
* Prohibit variable shadowing * Fix outstanding shadowed variables
Этот коммит содержится в:
коммит произвёл
Jesús Espino
родитель
cd30a1f242
Коммит
0c981aa010
2
Makefile
2
Makefile
@@ -290,7 +290,7 @@ clean-docker: ## Deletes the docker containers for local development.
|
|||||||
|
|
||||||
govet: ## Runs govet against all packages.
|
govet: ## Runs govet against all packages.
|
||||||
@echo Running GOVET
|
@echo Running GOVET
|
||||||
$(GO) vet $(GOFLAGS) $(TE_PACKAGES) || exit 1
|
$(GO) vet -shadow $(GOFLAGS) $(TE_PACKAGES) || exit 1
|
||||||
|
|
||||||
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
ifeq ($(BUILD_ENTERPRISE_READY),true)
|
||||||
$(GO) vet $(GOFLAGS) $(EE_PACKAGES) || exit 1
|
$(GO) vet $(GOFLAGS) $(EE_PACKAGES) || exit 1
|
||||||
|
|||||||
@@ -750,9 +750,9 @@ func TestPinPost(t *testing.T) {
|
|||||||
|
|
||||||
channel, err := th.App.GetChannelByName("town-square", th.BasicTeam.Id, true)
|
channel, err := th.App.GetChannelByName("town-square", th.BasicTeam.Id, true)
|
||||||
assert.Nil(t, err)
|
assert.Nil(t, err)
|
||||||
post := th.CreatePostWithClient(th.SystemAdminClient, channel)
|
adminPost := th.CreatePostWithClient(th.SystemAdminClient, channel)
|
||||||
|
|
||||||
_, resp := Client.PinPost(post.Id)
|
_, resp = Client.PinPost(adminPost.Id)
|
||||||
CheckForbiddenStatus(t, resp)
|
CheckForbiddenStatus(t, resp)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -330,7 +330,7 @@ func (a *App) getLinkMetadata(requestURL string, timestamp int64, isNewPost bool
|
|||||||
|
|
||||||
// Check the database if this isn't a new post. If it is a new post and the data is cached, it should be in memory.
|
// Check the database if this isn't a new post. If it is a new post and the data is cached, it should be in memory.
|
||||||
if !isNewPost {
|
if !isNewPost {
|
||||||
og, image, ok := a.getLinkMetadataFromDatabase(requestURL, timestamp)
|
og, image, ok = a.getLinkMetadataFromDatabase(requestURL, timestamp)
|
||||||
if ok {
|
if ok {
|
||||||
cacheLinkMetadata(requestURL, timestamp, og, image)
|
cacheLinkMetadata(requestURL, timestamp, og, image)
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user