Skip to content

Go Open Source Library Collection ​

Before You Start

  • Applies to: Go 1.21+ (examples verified with Go 1.22) · Prerequisites: Get Started · Read time: about 10 min

Collecting and organizing some open-source Go third-party libraries and frameworks for easy browsing. You are also welcome to submit PRs to add new projects.

TIP

The order does not represent ranking. Whether it's good to use depends on actual experience.

Web Frameworks ​

NameDescriptionRepository
ginClassic web frameworkhttps://github.com/gin-gonic/gin
beegoWeb framework developed by Chinese developershttps://github.com/beego/beego
irisClaims to be the fastest web frameworkhttps://github.com/kataras/iris
echoMinimalist high-performance web frameworkhttps://github.com/labstack/echo
gojiConcise web frameworkhttps://github.com/zenazn/goji
revelHigh-availability full-stack web frameworkhttps://github.com/revel/revel
buffaloCan simply build full-stack project web frameworkhttps://github.com/gobuffalo/buffalo
hertzMicroservice HTTP framework with high performance and strong scalability (open sourced by ByteDance)https://github.com/cloudwego/hertz
dotwebA simple micro web frameworkhttps://github.com/devfeel/dotweb
fiberNode.js Express style Web frameworkhttps://github.com/gofiber/fiber

ORM ​

NameDescriptionRepository
gormDeveloper-friendly ORM libraryhttps://github.com/go-gorm/gorm
xormSimple and powerful ORMhttps://gitea.com/xorm/xorm
entORM open sourced by FaceBookhttps://github.com/ent/ent
sqlxPowerful extension of sql libraryhttps://github.com/jmoiron/sqlx
beego/ormORM that comes with beegohttps://github.com/astaxie/beego/tree/master/orm
relExtensible modern ORMhttps://github.com/go-rel/rel
bunSQL-first ORMhttps://github.com/uptrace/bun

Microservice Frameworks ​

NameDescriptionRepository
kratosCloud-native microservice framework (open sourced by Bilibili)https://github.com/go-kratos/kratos
go-kitA microservice development tool libraryhttps://github.com/go-kit/kit
kitexHigh-performance and highly scalable microservice framework (open sourced by ByteDance)https://github.com/cloudwego/kitex
go-zeroCloud-native microservice framework (open sourced by Qiniu Cloud)https://github.com/zeromicro/go-zero
go-microA foreign microservice frameworkhttps://github.com/go-micro/go-micro
kiteMicroservice framework (hasn't been updated for a long time)https://github.com/koding/kite
dubbo-goJava dubbo implementation in Go (open sourced by Alibaba)https://github.com/apache/dubbo-go
tarsgotars implementation in Go (open sourced by Tencent)https://github.com/TarsCloud/TarsGo
juptiersGovernance-oriented microservice framework (open sourced by Douyu)https://github.com/douyu/jupiter
redsyncRedis distributed lockhttps://github.com/go-redsync/redsync

Easter Egg

Douyu's jupiter is the name of Zeus, the king of gods, and Bilibili's kratos is the name of Kratos, the god of war. Kratos later killed Zeus, the king of gods.

Logging Components ​

NameDescriptionRepository
logrusStructured logging libraryhttps://github.com/sirupsen/logrus
zapHigh-performance logging library open sourced by uberhttps://github.com/uber-go/zap
glogHierarchical execution logginghttps://github.com/golang/glog
zerologZero-allocation JSON logginghttps://github.com/rs/zerolog
apex/logStructured logging libraryhttps://github.com/apex/log
lumberjackLog splitting library, supports size splitting, date splitting, file compressionhttps://github.com/natefinch/lumberjack

Testing Components ​

NameDescriptionRepository
testifyMost popular testing toolkithttps://github.com/stretchr/testify
ginkgoModern testing frameworkhttps://github.com/onsi/ginkgo
ramsqlIn-memory SQL engine, mainly used for SQL unit testinghttps://github.com/proullon/ramsql
go-sqlmockSQL Mock for testinghttps://github.com/DATA-DOG/go-sqlmock
goconveyTest in browser visualizationhttps://github.com/smartystreets/goconvey
go-stress-testingStress testing toolhttps://github.com/link1st/go-stress-testing
xgoGo stub testing framework, implemented by rewriting code at compile timehttps://github.com/xhd2015/xgo
gomonkeyGo stub testing framework, implemented by modifying function addresseshttps://github.com/agiledragon/gomonkey

Data Processing ​

NameDescriptionRepository
mapstructureMap to struct conversionhttps://github.com/mitchellh/mapstructure
castConvenient data type conversionhttps://github.com/spf13/cast
deepcopyDeep copyhttps://github.com/mohae/deepcopy
copierCan copy values between structs with same field nameshttps://github.com/jinzhu/copier
go-pinyinChinese characters to pinyin conversionhttps://github.com/mozillazg/go-pinyin
go-streamsStream data processinghttps://github.com/reugn/go-streams
streamStream processinghttps://github.com/xyctruth/stream
go-humanizeConvert data to human-readable formathttps://github.com/dustin/go-humanize
unisegUnicode text segmentation, word wrapping, and string width calculation in Gohttps://github.com/rivo/uniseg

Data Validation ​

NameDescriptionRepository
go-playground/validator/v10Data validatorhttps://github.com/go-playground/validator
go-cmpLibrary for comparing values open sourced by Googlehttps://github.com/google/go-cmp
ozzo-validationRule-based data validation libraryhttps://github.com/go-ozzo/ozzo-validation
go-tagexprStruct tag validation libraryhttps://github.com/bytedance/go-tagexpr

Data Structures ​

NameDescriptionRepository
godsImplementation of common data structureshttps://github.com/emirpasic/gods
go-datastructuresImplementation of common data structureshttps://github.com/Workiva/go-datastructures
bisetImplementation of bitsets in Gohttps://github.com/bits-and-blooms/bitset
bloomImplementation of bloom filters in Gohttps://github.com/bits-and-blooms/bloom
dequeImplementation of high-performance double-ended queuehttps://github.com/edwingeng/deque
concurrent-mapConcurrent-safe sharded map implementationhttps://github.com/orcaman/concurrent-map
samber/loLodash-style data processing library with generics supporthttps://github.com/samber/lo
google/btreeBTree library implemented by Google with generics supporthttps://github.com/google/btree
gostlData structure library like C++STLhttps://github.com/liyue201/gostl

Mathematical Calculation ​

NameDescriptionRepository
gonumAnalogous to numpyhttps://github.com/gonum/gonum
decimalHigh-precision floating-point operation libraryhttps://github.com/shopspring/decimal
crunchA library that simplifies byte and bit operationshttps://github.com/superwhiskers/crunch
math-engineMathematical expression parsing and calculation engine libraryhttps://github.com/dengsgo/math-engine

Template Engines ​

NameDescriptionRepository
pongo2Django-style template enginehttps://github.com/flosch/pongo2
acehtml template enginehttps://github.com/yosssi/ace
mustachemustache implementation in Gohttps://github.com/hoisie/mustache
heroPowerful and fast template enginehttps://github.com/shiyanhui/hero
quictemplateAs the name suggests, high-performance template enginehttps://github.com/valyala/quicktemplate
amberTemplate engine derived from HAML and Jadehttps://github.com/eknkc/amber

Cache Components ​

NameDescriptionRepository
golang-lruThread-safe LRU and LRU 2Q cachehttps://github.com/hashicorp/golang-lru
ttlcacheIn-memory cache with TTL and generics supporthttps://github.com/jellydator/ttlcache
gocacheCache middleware managerhttps://github.com/eko/gocache
go-cacheIn-memory cache suitable for single-machine applications with TTL supporthttps://github.com/patrickmn/go-cache
ristrettoHigh-performance in-memory cachehttps://github.com/dgraph-io/ristretto
bigcacheIn-memory efficient large key cachehttps://github.com/allegro/bigcache

Databases & Drivers ​

NameDescriptionRepository
modernc.org/sqlitesqlite driver, pure Go, no cgo neededhttps://gitlab.com/cznic/sqlite
mattn/go-sqlite3sqlite driver, needs cgohttps://github.com/mattn/go-sqlite3
denisenkom/go-mssqldbsqlserver driver, rarely updated, recommend using Microsoft's versionhttps://github.com/denisenkom/go-mssqldb
microsoft/go-mssqldbsqlserver driver, new branch forked and maintained by Microsofthttps://github.com/microsoft/go-mssqldb
pgxpostgreSQL driverhttps://github.com/jackc/pgx/
mysqlmysql driverhttps://github.com/go-sql-driver/mysql
oci-go-sdkoracle official driverhttps://github.com/oracle/oci-go-sdk
go-oraoracle driver, pure Gohttps://github.com/sijms/go-ora
badgerEmbedded kv database based on LSMhttps://github.com/dgraph-io/badger
boltdbEmbedded kv database based on B+Treehttps://github.com/boltdb/bolt
goleveldbleveldb implementation in Go languagehttps://github.com/syndtr/goleveldb
qmgomongodb operation library open sourced by Qiniu Cloudhttps://github.com/qiniu/qmgo
mongo-go-drivermongodb official Go driverhttps://github.com/mongodb/mongo-go-driver
rqliteLightweight distributed relational database based on sqlitehttps://github.com/rqlite/rqlite/
go-mysqlA powerful MySQL tool collectionhttps://github.com/go-mysql-org/go-mysql
go-mysql-elasticsearchTool for syncing MySQL data to Elasticsearchhttps://github.com/go-mysql-org/go-mysql-elasticsearch
gofoundSingle-machine billion-level full-text search engine,https://github.com/sea-team/gofound
bleveFull-text search libraryhttps://github.com/blevesearch/bleve

Serialization ​

NameDescriptionRepository
go-iniini file serialization libraryhttps://github.com/go-ini/ini
sonicHigh-performance json serialization library open sourced by ByteDancehttps://github.com/bytedance/sonic
easyjsonjson fast serialization libraryhttps://github.com/mailru/easyjson
gjsonFast json key-value retrieval, non-traditional serialization libraryhttps://github.com/tidwall/gjson
go-yamlyaml serialization libraryhttps://github.com/go-yaml/yaml
go-tomltoml serialization libraryhttps://github.com/pelletier/go-toml
propertiesproperties serialization libraryhttps://github.com/magiconair/properties
viperSupports multiple data format serialization, also a configuration managerhttps://github.com/spf13/viper
configorMultiple data format serializer and configuration manager written by gorm authorhttps://github.com/jinzhu/configor

Command Line ​

NameDescriptionRepository
pflagPOSIX/GUN style flag packagehttps://github.com/spf13/pflag
go-flagsCommand parameter parserhttps://github.com/jessevdk/go-flags
cobraModern command line program scaffoldinghttps://github.com/spf13/cobra
dimiro1/bannerBeautiful banner construction libraryhttps://github.com/dimiro1/banner
go-prettyOutput beautiful command line tables, text, progress barshttps://github.com/jedib0t/go-pretty
progressbarThread-safe command line progress barhttps://github.com/schollz/progressbar
go-ansiWindows portable ANSI escape sequence utility for Go languagehttps://github.com/k0kubun/go-ansi
go-isattyLibrary for determining ttyhttps://github.com/mattn/go-isatty

Compression & Decompression ​

NameDescriptionRepository
klauspost/compressOptimization and modification of compress standard libraryhttps://github.com/klauspost/compress
alexmullins/zipFork branch of archive/zip standard library with password supporthttps://github.com/alexmullins/zip
mholt/archiverCompression and decompression tool library supporting many formats (personally highly recommended)https://github.com/mholt/archiver
go-carCAR archive file implementation in Gohttps://github.com/ipld/go-car
go-unarrA compression and decompression libraryhttps://github.com/gen2brain/go-unarr
xzPure Golang library for reading and writing xz compressed fileshttps://github.com/ulikunitz/xz

Date & Time ​

NameDescriptionRepository
carbonTime and date processing libraryhttps://github.com/golang-module/carbon
robfig/cronScheduled task libraryhttps://pkg.go.dev/github.com/robfig/cron/v3
gronScheduled task libraryhttps://github.com/roylee0704/gron
jobrunnerAsynchronous scheduled task frameworkhttps://github.com/bamzi/jobrunner
dataparseCan parse time strings without knowing the formathttps://github.com/araddon/dateparse
jinzhu/nowDate utility libraryhttps://github.com/jinzhu/now

Dependency Injection ​

NameDescriptionRepository
digDependency injection library open sourced by uber, based on reflectionhttps://darjun.github.io/2020/02/22/godailylib/dig/
wireDependency injection library open sourced by Google, based on code generationhttps://github.com/google/wire
injectDependency injection toolhttps://github.com/codegangsta/inject
diDependency injection containerhttps://github.com/sarulabs/di

Geographic Location ​

NameDescriptionRepository
geoip2-golangIP to geographic informationhttps://github.com/oschwald/geoip2-golang
ip2location-goIP to geographic informationhttps://github.com/ip2location/ip2location-go

Web Scraping Frameworks ​

NameDescriptionRepository
collySimple and powerful scraping frameworkhttps://github.com/gocolly/colly
goqueryjQuery-like HTML parsing for Gohttps://github.com/PuerkitoBio/goquery

Consensus Protocols ​

NameDescriptionRepository
hashicorp/raftRaft library open-sourced by Consulhttps://github.com/hashicorp/raft
hashicorp/memberlistGossip library open-sourced by Consulhttps://github.com/hashicorp/memberlist
etcd-io/raftRaft library open-sourced by etcdhttps://github.com/etcd-io/raft

OCR ​

NameDescriptionRepository
gosseractOCR library using the Tesseract C++ libhttps://github.com/otiai10/gosseract

Complete Example ​

The program below runs as-is: copy it into a file and execute go run main.go, or paste it into the Go Playground.

go
package main

import (
	"fmt"
	"sort"
)

func main() {
	// Before adding a dependency, check whether the standard library already
	// covers the job. Sorting, for example, rarely needs a third-party package.
	nums := []int{3, 1, 2}
	sort.Ints(nums)
	fmt.Println(nums)
}

Expected output:

text
[1 2 3]

Adding a dependency is a one-liner — the version is recorded in go.mod:

bash
go get github.com/gocolly/colly/v2@latest
go mod tidy

Common Pitfalls ​

  • Check the last commit date. An abandoned library is a future migration cost; prefer actively maintained projects.
  • Pinning matters. go get pkg@v1.2.3 records an exact version; go get pkg may bump it.
  • go mod tidy before committing. It keeps go.mod/go.sum consistent with the imports in your code.
  • Read the license. MIT/Apache-2.0 are permissive; GPL/AGPL impose obligations on distribution.
  • Avoid dependency soup. A small wrapper around the standard library is often cheaper than a new module.

Change Log ​

  • 2026-10-14: Added "Before You Start" notes, a complete runnable example with expected output, common pitfalls, and this change log. Completed the truncated Web Scraping table and restored the Consensus Protocols and OCR sections.

Golang by www.golangdev.cn · Adapted in part from Golang 中文学习文档 (MIT, © 寒江蓑笠翁)