Skip to content

No vendor SDK in the core

This module has one dependency, and it is not a vendor SDK: gitlab.com/phpboyscout/go/errors, which is itself standard-library-only and so adds one module and nothing beneath it. A depfootprint guard test asserts that on every run, over both the contract and the conformance harness, and names that module as the single permitted exception.

What that buys a consumer

Accepting a chatplatform.Reader in your function signature costs you this module and the standard library. It does not cost you a Discord client, a WebSocket stack, a JSON library or a rate limiter.

That matters most for the code furthest from the platform. A moderation scorer, a retrieval layer or a test helper that takes a Reader should not drag a gateway client into a build that never opens a socket.

What that buys an author

A provider is your module. Registering under a string key means a platform this module has never heard of ships without anything being contributed here, and without waiting for a release.

The rule that keeps it true

Every platform client lives behind a provider module boundary. A vendor SDK import anywhere outside its own provider module is a defect, and the guard test names the offenders individually so the coupling cannot creep back in:

var forbidden = []string{
    "github.com/bwmarrin/discordgo",
    "github.com/disgoorg/",
    "github.com/slack-go/slack",
    "gitlab.com/phpboyscout/go/chat-platform-",   // sibling providers
    "github.com/gorilla/websocket",               // transports belong in providers
    ...
}

Provider modules carry the mirror of it: a provider may depend on its own platform's SDK and no other's, and never on a sibling provider.

The one exception, and why it is not a cost

Sentinel errors are built with NewSentinel from gitlab.com/phpboyscout/go/errors, the toolkit's own error package, rather than the standard library's errors.New. Until August 2026 they used the standard library, and this page said so; the switch was made once that package was confirmed to import nothing but the standard library itself.

That is what keeps the property this page is about: a consumer accepting a Reader inherits one module with an empty require, not a graph. A zero-weight dependency graph is the thing worth guarding, and the guard test would fail on any module that brought weight with it. Providers are free to use whatever error library they like; they already have dependencies.