Open-source project
bytedance/gopkg avatar
bytedance/gopkg

gopkg: five utility catalogs extracted from ByteDance's internal Go codebase

Universal Utilities for Go

2,051 stars244 forksGoApache-2.0

At a glance

What is it?
gopkg is an Apache-2.0 utility library for Go, extracted from ByteDance's production codebase and organised into five catalogs covering caching, cloud patterns, data structures, standard library extensions and general tools. Its public documentation amounts to a catalog table and a single install command, so the depth of each package lives in the source files rather than any written reference.
Who is it for?
gopkg suits Go teams that want a utility collection tested in ByteDance's own production environment rather than assembled from separate libraries. Skip it when your team needs written API documentation, a changelog or any usage examples, because the README and the GitHub releases page provide none of those.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 26 days ago.
What is it written in?
Mainly Go, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 7, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • bytedance/gopkg2,051 ★ · +1
Star history
Repository2026-10-112026-11-07
bytedance/gopkg2.1k2.1k

1 Stars in the last 27 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

ByteDance extracted gopkg from an internal Go codebase used in production

When a Go utility crosses enough teams inside a company, the decision to open-source it is partly about reputation and partly about reducing the cost of maintaining a private fork. gopkg followed that path: ByteDance describes it as migrated from the internal codebase and extensively adopted in production, and the README adds that ByteDance still depends on the same repository in its production environment. That origin matters for trust in a way that a personal side project does not, because the maintainers have a concrete reason to keep the code working. What it does not give you is an independent benchmark, an adoption survey or any external measurement of reliability. The claim is the README's own sentence, and it is the only evidence of production use the documentation supplies.

The project names itself a universal utility collection for Go and situates its scope alongside Boost, a better standard library and cloud tools. Go's standard library is deliberately minimal. The gap between what it ships and what most production services need is real, and gopkg targets that gap, organised around five areas that cover enough ground to reduce the number of separate dependencies a team manages.

Five catalogs name the territory, with one-line descriptions and nothing further

The five subdirectories each carry a two-to-four-word description in the README's catalog table. Cache handles caching mechanisms. Cloud covers cloud computing design patterns, a term that in distributed systems usually encompasses constructs such as circuit breakers, retry policies and rate limiters, though the catalog page does not list specific implementations. Collection holds data structures. Lang extends the standard library. Util collects utilities useful across domains. That last description is deliberately broad, and it is the catalog that is hardest to evaluate from a name alone.

Beyond those five words per entry, the README is silent on API shape, supported algorithms, concurrency guarantees or comparison with well-known Go packages in each space. That gap has a direct consequence. For a category like collection, where Go already ships the sync and maps packages, the only way to know whether gopkg adds something useful is to read the Go source files under collection/. A Go programmer assessing the library spends their first real time in pkg.go.dev or in the source tree, not in the README, because the README ends at the catalog table.

One go get command covers all five catalogs, and Go 1.18 is the floor

The install command the README documents is:

bash
go get -u github.com/bytedance/gopkg@latest

This adds the entire module at its latest tagged version and updates it if an older version is already present. Because gopkg is one module with five internal catalogs, the command pulls in everything, even the catalogs a project does not import. Go's build system compiles only the packages your code actually imports, but the module source is fetched in full.

The go.mod file sets go 1.18 as the minimum version. Two external dependencies appear: golang.org/x/sync at v0.11.0 and golang.org/x/sys at v0.30.0. Both are from the golang.org/x namespace, maintained by the Go team under the same governance as the standard library, though not shipped with the Go distribution itself. No further dependencies appear in go.mod beyond those two.

Anyone adding gopkg to a project that already pins golang.org/x/sync or golang.org/x/sys will need to reconcile version constraints. Go modules use minimum version selection, so if your project already requires a version of x/sync higher than v0.11.0, the higher version wins. If it requires a lower version, adding gopkg raises that floor.

The internal/ directory is not importable from outside the module

At the top level, the repository contains eight directories alongside its configuration and license files: .github/, cache/, cloud/, collection/, internal/, lang/ and util/. Five of those directories match the named catalogs. A sixth directory, internal/, behaves differently.

In Go, packages under a directory named internal can only be imported by code within the same module's tree. Nothing outside github.com/bytedance/gopkg can import a package path that contains internal/ as a component. This means the five public catalogs may share implementation code through internal/ without exposing it to external consumers. For a user of gopkg, internal/ is invisible at import time, but knowing it exists explains why the catalog API may not be fully described by what you see at the top level of each catalog directory. Part of the implementation is only visible by following imports from within the catalog source.

An engineer reading cache/ to understand a particular implementation will find the full picture only by following internal/ imports, not by looking at cache/ alone. This is a standard Go pattern, but it is worth stating because the README does not mention it.

No API reference, no examples directory and no changelog in the repository

The README gives no examples beyond the install command, no API walkthrough for any of the five catalogs, no configuration options, and no mention of known limitations or edge cases. There is no CHANGELOG file at the repository root. The GitHub releases page carries no release notes attached to any of the three tagged versions. The Releases section of the README says only that tagged versions are recommended for stability and that development happens on the main branch.

This is not unusual for a utility library extracted from a private codebase: internal users knew the API because they worked alongside it, and that knowledge was not written down before the public release. For a new external user, the gap is the main friction point. Reaching the actual API means reading the Go source code or navigating pkg.go.dev, where the package comment and type signatures are the only documentation.

There is also no comparative discussion in any README section. Whether gopkg's data structures in collection/ overlap with what the standard library already provides, or whether its cloud patterns cover the same territory as other Go libraries, is not addressed. Any such comparison requires reading and comparing source code directly.

Three tagged releases in the 0.1 series, last push on 2026-09-18

Three tagged releases appear in the repository listing: v0.1.2 on 2025-04-01, v0.1.3 on 2025-08-13 and v0.1.4 on 2026-03-17. On 2026-09-18, the most recent push to the main branch arrived after the latest tag, which means commits exist between v0.1.4 and the current state of main. Its stated policy is to develop on main and tag releases when stable, so a gap between the last push and the latest release is consistent with that workflow rather than a sign of abandonment.

All version numbers are in the 0.1 series. In Go module conventions, this signals that the API surface is not yet committed to stability. A module at v0.x can alter exported types, function signatures or package structure in a minor version increment without requiring the import-path versioning that a v2 module would impose. If gopkg increments beyond v0.1.4 while your project pins it, breaking changes are possible. Checking the source diff between versions is the practical guard, not relying on the semantic version number alone.

The repository is not archived. A CONTRIBUTING.md and a CODE_OF_CONDUCT.md sit at the root. CREDITS is also present at the top level.

Apache-2.0 covers the whole module, and CONTRIBUTING.md holds the contribution guidelines

gopkg is licensed under Apache-2.0. The module-level license covers the entire repository, and .licenserc.yaml at the root is the license-checker configuration used to enforce that all source files carry the appropriate header. Apache-2.0 allows use, modification and distribution with the attribution and notice requirements the full license text describes. Nothing in the README or repository structure restricts commercial use.

A CONTRIBUTING.md sits at the root, which is where contribution guidelines are documented. ByteDance has an internal workflow with conventions not obvious from a fresh fork, so reading CONTRIBUTING.md before opening a pull request is the path the repository structure implies. CODE_OF_CONDUCT.md is also present. For teams that want to contribute a utility or fix a bug, those two files are the starting point.

The CREDITS file at the top level is one more file to read before redistribution. Read it to check whether any third-party code was included in the project, which affects how you may redistribute a modified build under the Apache-2.0 terms.

Editorial conclusion

gopkg suits Go teams that want a utility collection tested in ByteDance's own production environment rather than assembled from separate libraries. Skip it when your team needs written API documentation, a changelog or any usage examples, because the README and the GitHub releases page provide none of those. Before adopting a catalog, read the Go source under that directory, follow any internal/ imports, and note that all versions are in the 0.1 series with no stability commitment. Version v0.1.4 arrived on 2026-03-17 and the last push was on 2026-09-18.

Frequently asked questions

What Go version does gopkg require?

The go.mod file sets go 1.18 as the minimum version. The only external dependencies declared are golang.org/x/sync at v0.11.0 and golang.org/x/sys at v0.30.0.

How do I add gopkg to my Go project?

The README gives the command go get -u github.com/bytedance/gopkg@latest. That fetches or updates the module at its latest tagged version.

Is gopkg still maintained?

The repository is not archived. Version v0.1.4 was tagged on 2026-03-17, and the last push was on 2026-09-18. ByteDance states in the README that the project is used in their production environment.

What license does gopkg use?

gopkg is licensed under Apache-2.0. The .licenserc.yaml file at the repository root enforces that all source files carry the appropriate license header.

What are the five catalogs in gopkg?

The README lists cache for caching mechanisms, cloud for cloud computing design patterns, collection for data structures, lang for enhanced standard libraries and util for utilities useful across domains.

Official sources

  1. bytedance/gopkg on GitHub
  2. Issues
  3. License: Apache-2.0
  4. README
  5. Releases
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/bytedance-gopkg.svg)](https://hysenlabs.com/projects/bytedance-gopkg)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/bytedance-gopkg.svg)](https://hysenlabs.com/projects/bytedance-gopkg)

Was this useful?