What Go Versions Are Supported by the go-modern-guidelines Database?

The go-modern-guidelines database supports Go versions 1.0 through 1.27 inclusive, covering every modern language feature from the initial release through the latest stable version.

The JetBrains/go-modern-guidelines repository maintains a comprehensive, machine-readable database of modern Go language features. Understanding which Go versions are supported by this database is essential for developers using the associated CLI tools to modernize their Go codebases according to project constraints.

Supported Version Range in go-modern-guidelines

The database explicitly supports Go 1.0 through Go 1.27, ensuring backward compatibility with legacy codebases while incorporating the latest language idioms.

Documentation in README.md

According to the source code in README.md (lines 9-10), the repository maintains guidelines spanning the complete version history of Go. The documentation specifies that the database covers features introduced in every major and minor release from 1.0 up to and including 1.27.

Database Structure in guidelines.json

Each guideline entry in internal/guidelines/guidelines.json includes a since_version field indicating the minimum Go version required for that feature. Entries contain values like "since_version":"1.27" for recent features, allowing the system to filter applicable recommendations based on the target version specified in your project's go.mod file.

CLI Requirements vs. Guideline Coverage

While the guidelines themselves support versions dating back to 1.0, the tooling that consumes this database maintains separate runtime requirements.

Minimum Version for CLI Execution

The command-line interface requires Go 1.25 or newer to execute. This minimum version stems from the CLI's own implementation dependencies and modern compiler features required to build the tool from source.

Automatic Toolchain Switching

Despite the CLI's Go 1.25 requirement, older target toolchains remain fully supported through Go's automatic toolchain switching mechanism. When GOTOOLCHAIN=auto is configured, the system automatically downloads and uses the appropriate Go version for analysis. This allows the CLI to evaluate projects targeting Go 1.0 through 1.27 even when installed on systems running newer Go installations.

Working with Go Versions in Code

The repository provides utilities in internal/goversion/goversion.go for resolving project versions and determining guideline applicability programmatically.

Resolving Project Versions

To detect the Go version for a specific project, the goversion.Resolve function reads the go.mod file or falls back to the local toolchain:

// Resolve the Go version for a project (reads go.mod or falls back to local toolchain)
ver, err := goversion.Resolve("", "", "devel")
if err != nil {
    log.Fatalf("cannot determine Go version: %v", err)
}
fmt.Println("Project Go version:", ver) // e.g. "1.24"

Checking Feature Applicability

You can determine whether a specific guideline applies to your target version by comparing semantic version strings using goversion.Compare:

// Check whether a specific guideline is applicable for a given version
func supports(version, since string) bool {
    // both strings are major.minor (e.g., "1.24")
    return goversion.Compare(version, since) >= 0
}

// Example: Is `strings_split_seq` (since 1.24) usable?
if supports("1.24", "1.24") {
    fmt.Println("Feature available")
}

This comparison logic allows the database to filter recommendations dynamically based on the project's declared Go version or the inferred local toolchain version.

Key Files Defining Version Support

Several source files work together to enforce and document the supported Go version range:

  • README.md – Contains the high-level overview explicitly documenting the 1.0–1.27 version range
  • FEATURES.md – Provides a detailed list of every guideline with its corresponding since_version field
  • internal/goversion/goversion.go – Implements version parsing and normalized comparison logic used to resolve project versions
  • internal/guidelines/guidelines.json – Stores the machine-readable database where each entry specifies the minimum Go version via the since_version field

Summary

  • The go-modern-guidelines database supports Go 1.0 through Go 1.27 inclusive according to the JetBrains/go-modern-guidelines source code
  • Version applicability is determined by the since_version field present in every entry of internal/guidelines/guidelines.json
  • While the CLI requires Go 1.25+ to run, it supports analyzing projects targeting older versions via GOTOOLCHAIN=auto
  • The internal/goversion/goversion.go package provides Resolve and Compare utilities for determining project versions from go.mod or local toolchain
  • Guidelines are filtered based on semantic version comparison to ensure only applicable modernizations are suggested

Frequently Asked Questions

What is the minimum Go version supported by the go-modern-guidelines database?

The database supports Go versions as early as 1.0, covering the entire language history through Go 1.27. Each guideline entry specifies its minimum required version via the since_version field in internal/guidelines/guidelines.json.

Can I use the go-modern-guidelines CLI with an older Go installation?

The CLI itself requires Go 1.25 or newer to execute due to its implementation dependencies. However, you can analyze projects targeting older Go versions because the tool uses GOTOOLCHAIN=auto to automatically download and switch to appropriate toolchain versions when needed.

How does the database determine which guidelines apply to my project?

The system reads your project's Go version from go.mod using goversion.Resolve in internal/goversion/goversion.go, or detects it from the local toolchain. It then compares this version against each guideline's since_version field using goversion.Compare to filter applicable recommendations.

Where is the supported version range documented in the source code?

The supported range of Go 1.0 through 1.27 is explicitly documented in README.md at lines 9-10. The actual data enforcement occurs in internal/guidelines/guidelines.json, where every guideline entry contains a since_version string indicating the minimum Go version required for that feature.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →