MM-27456: Use reflect-free serialization for hot structs (#15171)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
32b7d2b5f1
Коммит
91a76b2df9
9
Makefile
9
Makefile
@@ -554,7 +554,7 @@ vet: ## Run mattermost go vet specific checks
|
||||
echo "mattermost-govet is not installed. Please install it executing \"GO111MODULE=off GOBIN=$(PWD)/bin go get -u github.com/mattermost/mattermost-govet\""; \
|
||||
exit 1; \
|
||||
fi;
|
||||
@VET_CMD="-license -structuredLogging -inconsistentReceiverName -tFatal"; \
|
||||
@VET_CMD="-license -structuredLogging -inconsistentReceiverName -inconsistentReceiverName.ignore=serialized_gen.go -tFatal"; \
|
||||
if ! [ -z "${MM_VET_OPENSPEC_PATH}" ] && [ -f "${MM_VET_OPENSPEC_PATH}" ]; then \
|
||||
VET_CMD="$$VET_CMD -openApiSync -openApiSync.spec=$$MM_VET_OPENSPEC_PATH"; \
|
||||
else \
|
||||
@@ -567,6 +567,13 @@ ifneq ($(MM_NO_ENTERPRISE_LINT),true)
|
||||
endif
|
||||
endif
|
||||
|
||||
gen-serialized: ## Generates serialization methods for hot structs
|
||||
# This tool only works at a file level, not at a package level.
|
||||
# So you would need to move the structs that need to be serialized temporarily
|
||||
# to session.go and run the tool.
|
||||
$(GO) get -modfile=go.tools.mod github.com/tinylib/msgp
|
||||
$(GOBIN)/msgp -file=./model/session.go -tests=false -o=./model/serialized_gen.go
|
||||
|
||||
todo: ## Display TODO and FIXME items in the source code.
|
||||
@! ag --ignore Makefile --ignore-dir vendor --ignore-dir runtime TODO
|
||||
@! ag --ignore Makefile --ignore-dir vendor --ignore-dir runtime XXX
|
||||
|
||||
Ссылка в новой задаче
Block a user