Files
zeekay 8feb24ea1f One name for this fork, and it is ours
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.
2026-08-28 23:35:36 -07:00
..
…
…

Mattermost Go Vet

This package contains mattermost-specific go-vet rules that are used to maintain code consistency in mattermost.

Included analyzers

  1. equalLenAsserts - check for (require/assert).Equal(t, X, len(Y))
  2. inconsistentReceiverName - check for inconsistent receiver names in the methods of a struct
  3. license - check the license header
  4. openApiSync - check for inconsistencies between OpenAPI spec and the source code
  5. structuredLogging - check invalid usage of logging (must use structured logging)
  6. tFatal - check invalid usage of t.Fatal assertions (instead of testify methods)
  7. apiAuditLogs - check that audit records are properly created in the API layer
  8. rawSql - check invalid usage of raw SQL queries instead of using the squirrel lib
  9. emptyStrCmp - check for idiomatic empty string comparisons
  10. pointerToSlice - check for usage of pointer to slice in function definitions
  11. mutexLock - check for cases where a mutex is left locked before returning
  12. wrapError - check for original errors being passed as details rather than wrapped
  13. noSelectStar - check for SQL queries using SELECT * which breaks forwards compatibility
  14. 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 ./...