This document details how dependencies are managed in the go-dota2 project, including Go module configuration, the tools sub-module for development tooling, and automated dependency updates.
The go-dota2 project uses Go modules for dependency management. Runtime and code-generation dependencies are declared in the root go.mod. Integrity is maintained via cryptographic checksums in the go.sum file, ensuring that the module graph remains stable and verifiable across different environments.
Dependency configuration flow:
Title: Dependency Configuration and Verification Flow
Sources: go.mod1-31 go.sum1-79 deps.go1-9
The root go.mod file at go.mod1-3 declares the module path and the required Go version:
The following direct dependencies are required for the library's runtime operation and the internal API generation tool (apigen).
| Dependency | Version | Role in codebase |
|---|---|---|
github.com/paralin/go-steam | v0.0.0-20260627093619-6b06e91640b1 | Steam network transport and authentication; provides the base steam.Client. |
github.com/aperturerobotics/protobuf-go-lite | v0.14.0 | Lightweight protobuf runtime used for modern message handling. |
github.com/golang/protobuf | v1.5.4 | Legacy Protocol Buffer support; used by many generated protocol/*.pb.go files. |
google.golang.org/protobuf | v1.36.11 | Modern Go Protobuf runtime (v2). |
github.com/pkg/errors | v0.9.1 | Error wrapping and stack traces throughout the library. |
github.com/fatih/camelcase | v1.0.0 | CamelCase string splitting; used by apigen during code generation. |
github.com/serenize/snaker | v0.0.0-20201027110005-a7ad2135616e | Snake/camel case conversion; used by apigen. |
github.com/sirupsen/logrus | v1.9.5-0.20260508084601-d4a50659cfd6 | Structured logging; the Dota2 struct consumes a logrus.FieldLogger. |
github.com/urfave/cli/v2 | v2.27.7 | CLI framework for development tools and generators. |
Mapping Dependencies to Code Entities:
Title: Runtime and Generator Dependency Mapping
Sources: go.mod5-19 .protoc-manifest.json6-80
Indirect dependencies are pulled in by the direct requirements above. Notable entries include testing frameworks and terminal utilities.
| Dependency | Version | Pulled in by |
|---|---|---|
github.com/cpuguy83/go-md2man/v2 | v2.0.7 | urfave/cli/v2 |
github.com/onsi/ginkgo | v1.16.5 | paralin/go-steam (testing) |
github.com/onsi/gomega | v1.39.1 | paralin/go-steam (testing) |
github.com/russross/blackfriday/v2 | v2.1.0 | urfave/cli/v2 |
github.com/xrash/smetrics | v0.0.0-20250705151800-55b8f293f342 | urfave/cli/v2 |
golang.org/x/sys | v0.44.0 | sirupsen/logrus |
Sources: go.mod21-30
The project utilizes a multi-layered protobuf stack to bridge legacy generated code with modern runtimes and high-performance requirements:
github.com/aperturerobotics/protobuf-go-lite v0.14.0: A primary dependency go.mod6 It is used by the code generation pipeline to produce lightweight, efficient Go code.github.com/golang/protobuf v1.5.4: A direct dependency go.mod13 The generated files in the protocol/ directory reference this package for compatibility with the legacy Protobuf API.google.golang.org/protobuf v1.36.11: A direct dependency go.mod18 This provides the modern Go Protobuf runtime (v2).github.com/aperturerobotics/protobuf: This dependency is explicitly imported in deps.go with a blank identifier (_) to ensure that protobuf include files remain vendored for the protoc compiler deps.go5-8Sources: go.mod6 go.mod13 go.mod18 deps.go5-8
The go.sum file (go.sum1-79..) records cryptographic checksums (SHA-256 hashes) for every module version referenced.
sum.golang.org) on every build..protoc-manifest.json file which tracks the specific versions of tools used during protobuf generation, such as protobuf-go-lite=v0.14.0 and starpc=v0.49.18, as well as hashes for the generated files .protoc-manifest.json1-5Sources: go.sum1-79 .protoc-manifest.json1-5
Dependency updates are managed via Renovate Bot, configured in .github/renovate.json
fix, deps, or chore .github/renovate.json4replace directives in go.mod are disabled .github/renovate.json12-15 and major version updates for github.com/urfave/cli are ignored to prevent breaking changes in the generation tools .github/renovate.json17-21Sources: .github/renovate.json1-23