mirror of
https://github.com/hanzoai/team.git
synced 2026-09-30 01:57:35 +00:00
The server module named github.com/hanzoai/team/server/v8 — a path that resolves to the retired workspace's repository, not this one — while server/public still published github.com/mattermost/mattermost/server/public. Both are github.com/hanzoteam/server/... now, which is where this code actually lives. That second half is what made the binary unbootable. Upstream's public path stayed claimed by upstream, mattermost-plugin-ai imported it, and the build linked public/model twice; public/plugin's gob.Register then ran twice under one name and panicked at init, before main. Reverting the rename traded the brand for a working binary. Rebranding the plugin alongside it needs no such trade: the agents fork is github.com/hanzoteam/agents/v2 against our public module, so no module named mattermost/mattermost is in the graph at all. Measured: `go list -deps ./cmd/mattermost` names exactly one public/model, and it is ours.
Mattermost Go Vet
This package contains mattermost-specific go-vet rules that are used to maintain code consistency in mattermost.
Included analyzers
- equalLenAsserts - check for (require/assert).Equal(t, X, len(Y))
- inconsistentReceiverName - check for inconsistent receiver names in the methods of a struct
- license - check the license header
- openApiSync - check for inconsistencies between OpenAPI spec and the source code
- structuredLogging - check invalid usage of logging (must use structured logging)
- tFatal - check invalid usage of t.Fatal assertions (instead of testify methods)
- apiAuditLogs - check that audit records are properly created in the API layer
- rawSql - check invalid usage of raw SQL queries instead of using the squirrel lib
- emptyStrCmp - check for idiomatic empty string comparisons
- pointerToSlice - check for usage of pointer to slice in function definitions
- mutexLock - check for cases where a mutex is left locked before returning
- wrapError - check for original errors being passed as details rather than wrapped
- noSelectStar - check for SQL queries using SELECT * which breaks forwards compatibility
- requestCtxNaming - check that request.CTX parameters are consistently named 'rctx'
Running Locally
Mattermost Go Vet lives in the tools/mattermost-govet/ directory of the mattermost/mattermost repo. It can also be imported and installed independently for use by plugins or other projects:
go install github.com/mattermost/mattermost/tools/mattermost-govet@latest
To build and run locally from the repo:
cd tools/mattermost-govet && go install .
go vet -vettool=$(go env GOPATH)/bin/mattermost-govet ./...