This document covers the installation of the go-dota2 library as a dependency in your Go project, including prerequisite requirements, dependency verification, and initial setup steps. For information about creating and using a Dota2 client instance, see 1.2 Basic Usage
The go-dota2 library is distributed as a Go module at github.com/paralin/go-dota2. Installation follows standard Go module conventions using go get. The library requires Go 1.25 or later and depends on go-steam as its networking foundation and Protocol Buffers for message serialization.
Sources: go.mod1-24 go.sum1-100
The library requires Go 1.25.0 or later, as specified in go.mod3 This version requirement ensures compatibility with the module's language features and dependency constraints.
To verify your Go installation:
The output should show go1.25.0 or later.
No platform-specific dependencies are required. The library:
protoc compiler for cross-platform protocol generation (eliminating the need for system-installed protoc).github.com/aperturerobotics/protobuf-go-lite for optimized message handling go.mod6Install the library using Go's module system:
This command:
go-dota2.go.mod file with the dependency.go.sum with cryptographic checksums.The following diagram shows the module's dependency structure as defined in go.mod1-31:
Diagram: Module Dependency Structure
Sources: go.mod5-19
The library has several direct dependencies defined in go.mod5-19:
| Dependency | Version | Purpose |
|---|---|---|
github.com/paralin/go-steam | v0.0.0-20260627093619-6b06e91640b1 | Steam client protocol and network transport |
github.com/aperturerobotics/protobuf-go-lite | v0.14.0 | Lightweight Protocol Buffer runtime |
github.com/golang/protobuf | v1.5.4 | Legacy Protocol Buffer support |
github.com/pkg/errors | v0.9.1 | Error wrapping and context |
github.com/sirupsen/logrus | v1.9.5-0.20260508084601-d4a50659cfd6 | Structured logging |
github.com/urfave/cli/v2 | v2.27.7 | CLI tools for code generation |
Sources: go.mod5-19
The go-steam dependency at go.mod7 is the foundational networking layer. The go-dota2 client builds on top of go-steam to communicate with the Dota 2 Game Coordinator.
Relationship Diagram: go-dota2 and go-steam
Sources: go.mod7
The module uses a modern protobuf stack:
github.com/aperturerobotics/protobuf-go-lite go.mod6 - Optimized runtime for generated code.google.golang.org/protobuf go.mod18 - Standard Go protobuf implementation.github.com/aperturerobotics/protobuf go.mod11 - Used for vendoring include files for the generation pipeline deps.go7Sources: go.mod6 go.mod11 go.mod18 deps.go7
Go automatically verifies dependency integrity using checksums in go.sum1-100 Each dependency has checksums for both the module definition and the source archive.
Example for go-steam from go.sum61-62:
github.com/paralin/go-steam v0.0.0-20260627093619-6b06e91640b1 h1:elw8kZSd4aBwhp+4Q6Qsy2OFimhKIVt7qwjNRUc2re8=
github.com/paralin/go-steam v0.0.0-20260627093619-6b06e91640b1/go.mod h1:KBuqfbUuB30OSp5ZbPDVHR5lKUPQADt9uD9M3LPx+70=
Sources: go.sum61-62
After installation, verify the module can be imported:
The main package is imported as github.com/paralin/go-dota2. This provides access to the Dota2 client type.
Protocol Buffer message types and constants (like EDOTAGCMsg) are located in the protocol subpackage protocol/.protoc-manifest.json6-127
The protocol package contains generated files for chat, lobbies, matches, and more protocol/.protoc-manifest.json8-79
Import Structure Diagram
Refresh this wiki