Go Open Source Library Collection
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
| Name | Description | Repository |
|---|---|---|
| gin | Classic web framework | https://github.com/gin-gonic/gin |
| beego | Web framework developed by Chinese developers | https://github.com/beego/beego |
| iris | Claims to be the fastest web framework | https://github.com/kataras/iris |
| echo | Minimalist high-performance web framework | https://github.com/labstack/echo |
| goji | Concise web framework | https://github.com/zenazn/goji |
| revel | High-availability full-stack web framework | https://github.com/revel/revel |
| buffalo | Can simply build full-stack project web framework | https://github.com/gobuffalo/buffalo |
| hertz | Microservice HTTP framework with high performance and strong scalability (open sourced by ByteDance) | https://github.com/cloudwego/hertz |
| dotweb | A simple micro web framework | https://github.com/devfeel/dotweb |
| fiber | Node.js Express style Web framework | https://github.com/gofiber/fiber |
ORM
| Name | Description | Repository |
|---|---|---|
| gorm | Developer-friendly ORM library | https://github.com/go-gorm/gorm |
| xorm | Simple and powerful ORM | https://gitea.com/xorm/xorm |
| ent | ORM open sourced by FaceBook | https://github.com/ent/ent |
| sqlx | Powerful extension of sql library | https://github.com/jmoiron/sqlx |
| beego/orm | ORM that comes with beego | https://github.com/astaxie/beego/tree/master/orm |
| rel | Extensible modern ORM | https://github.com/go-rel/rel |
| bun | SQL-first ORM | https://github.com/uptrace/bun |
Microservice Frameworks
| Name | Description | Repository |
|---|---|---|
| kratos | Cloud-native microservice framework (open sourced by Bilibili) | https://github.com/go-kratos/kratos |
| go-kit | A microservice development tool library | https://github.com/go-kit/kit |
| kitex | High-performance and highly scalable microservice framework (open sourced by ByteDance) | https://github.com/cloudwego/kitex |
| go-zero | Cloud-native microservice framework (open sourced by Qiniu Cloud) | https://github.com/zeromicro/go-zero |
| go-micro | A foreign microservice framework | https://github.com/go-micro/go-micro |
| kite | Microservice framework (hasn't been updated for a long time) | https://github.com/koding/kite |
| dubbo-go | Java dubbo implementation in Go (open sourced by Alibaba) | https://github.com/apache/dubbo-go |
| tarsgo | tars implementation in Go (open sourced by Tencent) | https://github.com/TarsCloud/TarsGo |
| juptiers | Governance-oriented microservice framework (open sourced by Douyu) | https://github.com/douyu/jupiter |
| redsync | Redis distributed lock | https://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
| Name | Description | Repository |
|---|---|---|
| logrus | Structured logging library | https://github.com/sirupsen/logrus |
| zap | High-performance logging library open sourced by uber | https://github.com/uber-go/zap |
| glog | Hierarchical execution logging | https://github.com/golang/glog |
| zerolog | Zero-allocation JSON logging | https://github.com/rs/zerolog |
| apex/log | Structured logging library | https://github.com/apex/log |
| lumberjack | Log splitting library, supports size splitting, date splitting, file compression | https://github.com/natefinch/lumberjack |
Testing Components
| Name | Description | Repository |
|---|---|---|
| testify | Most popular testing toolkit | https://github.com/stretchr/testify |
| ginkgo | Modern testing framework | https://github.com/onsi/ginkgo |
| ramsql | In-memory SQL engine, mainly used for SQL unit testing | https://github.com/proullon/ramsql |
| go-sqlmock | SQL Mock for testing | https://github.com/DATA-DOG/go-sqlmock |
| goconvey | Test in browser visualization | https://github.com/smartystreets/goconvey |
| go-stress-testing | Stress testing tool | https://github.com/link1st/go-stress-testing |
| xgo | Go stub testing framework, implemented by rewriting code at compile time | https://github.com/xhd2015/xgo |
| gomonkey | Go stub testing framework, implemented by modifying function addresses | https://github.com/agiledragon/gomonkey |
Data Processing
| Name | Description | Repository |
|---|---|---|
| mapstructure | Map to struct conversion | https://github.com/mitchellh/mapstructure |
| cast | Convenient data type conversion | https://github.com/spf13/cast |
| deepcopy | Deep copy | https://github.com/mohae/deepcopy |
| copier | Can copy values between structs with same field names | https://github.com/jinzhu/copier |
| go-pinyin | Chinese characters to pinyin conversion | https://github.com/mozillazg/go-pinyin |
| go-streams | Stream data processing | https://github.com/reugn/go-streams |
| stream | Stream processing | https://github.com/xyctruth/stream |
| go-humanize | Convert data to human-readable format | https://github.com/dustin/go-humanize |
| uniseg | Unicode text segmentation, word wrapping, and string width calculation in Go | https://github.com/rivo/uniseg |
Data Validation
| Name | Description | Repository |
|---|---|---|
| go-playground/validator/v10 | Data validator | https://github.com/go-playground/validator |
| go-cmp | Library for comparing values open sourced by Google | https://github.com/google/go-cmp |
| ozzo-validation | Rule-based data validation library | https://github.com/go-ozzo/ozzo-validation |
| go-tagexpr | Struct tag validation library | https://github.com/bytedance/go-tagexpr |
Data Structures
| Name | Description | Repository |
|---|---|---|
| gods | Implementation of common data structures | https://github.com/emirpasic/gods |
| go-datastructures | Implementation of common data structures | https://github.com/Workiva/go-datastructures |
| biset | Implementation of bitsets in Go | https://github.com/bits-and-blooms/bitset |
| bloom | Implementation of bloom filters in Go | https://github.com/bits-and-blooms/bloom |
| deque | Implementation of high-performance double-ended queue | https://github.com/edwingeng/deque |
| concurrent-map | Concurrent-safe sharded map implementation | https://github.com/orcaman/concurrent-map |
| samber/lo | Lodash-style data processing library with generics support | https://github.com/samber/lo |
| google/btree | BTree library implemented by Google with generics support | https://github.com/google/btree |
| gostl | Data structure library like C++STL | https://github.com/liyue201/gostl |
Mathematical Calculation
| Name | Description | Repository |
|---|---|---|
| gonum | Analogous to numpy | https://github.com/gonum/gonum |
| decimal | High-precision floating-point operation library | https://github.com/shopspring/decimal |
| crunch | A library that simplifies byte and bit operations | https://github.com/superwhiskers/crunch |
| math-engine | Mathematical expression parsing and calculation engine library | https://github.com/dengsgo/math-engine |
Template Engines
| Name | Description | Repository |
|---|---|---|
| pongo2 | Django-style template engine | https://github.com/flosch/pongo2 |
| ace | html template engine | https://github.com/yosssi/ace |
| mustache | mustache implementation in Go | https://github.com/hoisie/mustache |
| hero | Powerful and fast template engine | https://github.com/shiyanhui/hero |
| quictemplate | As the name suggests, high-performance template engine | https://github.com/valyala/quicktemplate |
| amber | Template engine derived from HAML and Jade | https://github.com/eknkc/amber |
Cache Components
| Name | Description | Repository |
|---|---|---|
| golang-lru | Thread-safe LRU and LRU 2Q cache | https://github.com/hashicorp/golang-lru |
| ttlcache | In-memory cache with TTL and generics support | https://github.com/jellydator/ttlcache |
| gocache | Cache middleware manager | https://github.com/eko/gocache |
| go-cache | In-memory cache suitable for single-machine applications with TTL support | https://github.com/patrickmn/go-cache |
| ristretto | High-performance in-memory cache | https://github.com/dgraph-io/ristretto |
| bigcache | In-memory efficient large key cache | https://github.com/allegro/bigcache |
Databases & Drivers
| Name | Description | Repository |
|---|---|---|
| modernc.org/sqlite | sqlite driver, pure Go, no cgo needed | https://gitlab.com/cznic/sqlite |
| mattn/go-sqlite3 | sqlite driver, needs cgo | https://github.com/mattn/go-sqlite3 |
| denisenkom/go-mssqldb | sqlserver driver, rarely updated, recommend using Microsoft's version | https://github.com/denisenkom/go-mssqldb |
| microsoft/go-mssqldb | sqlserver driver, new branch forked and maintained by Microsoft | https://github.com/microsoft/go-mssqldb |
| pgx | postgreSQL driver | https://github.com/jackc/pgx/ |
| mysql | mysql driver | https://github.com/go-sql-driver/mysql |
| oci-go-sdk | oracle official driver | https://github.com/oracle/oci-go-sdk |
| go-ora | oracle driver, pure Go | https://github.com/sijms/go-ora |
| badger | Embedded kv database based on LSM | https://github.com/dgraph-io/badger |
| boltdb | Embedded kv database based on B+Tree | https://github.com/boltdb/bolt |
| goleveldb | leveldb implementation in Go language | https://github.com/syndtr/goleveldb |
| qmgo | mongodb operation library open sourced by Qiniu Cloud | https://github.com/qiniu/qmgo |
| mongo-go-driver | mongodb official Go driver | https://github.com/mongodb/mongo-go-driver |
| rqlite | Lightweight distributed relational database based on sqlite | https://github.com/rqlite/rqlite/ |
| go-mysql | A powerful MySQL tool collection | https://github.com/go-mysql-org/go-mysql |
| go-mysql-elasticsearch | Tool for syncing MySQL data to Elasticsearch | https://github.com/go-mysql-org/go-mysql-elasticsearch |
| gofound | Single-machine billion-level full-text search engine, | https://github.com/sea-team/gofound |
| bleve | Full-text search library | https://github.com/blevesearch/bleve |
Serialization
| Name | Description | Repository |
|---|---|---|
| go-ini | ini file serialization library | https://github.com/go-ini/ini |
| sonic | High-performance json serialization library open sourced by ByteDance | https://github.com/bytedance/sonic |
| easyjson | json fast serialization library | https://github.com/mailru/easyjson |
| gjson | Fast json key-value retrieval, non-traditional serialization library | https://github.com/tidwall/gjson |
| go-yaml | yaml serialization library | https://github.com/go-yaml/yaml |
| go-toml | toml serialization library | https://github.com/pelletier/go-toml |
| properties | properties serialization library | https://github.com/magiconair/properties |
| viper | Supports multiple data format serialization, also a configuration manager | https://github.com/spf13/viper |
| configor | Multiple data format serializer and configuration manager written by gorm author | https://github.com/jinzhu/configor |
Command Line
| Name | Description | Repository |
|---|---|---|
| pflag | POSIX/GUN style flag package | https://github.com/spf13/pflag |
| go-flags | Command parameter parser | https://github.com/jessevdk/go-flags |
| cobra | Modern command line program scaffolding | https://github.com/spf13/cobra |
| dimiro1/banner | Beautiful banner construction library | https://github.com/dimiro1/banner |
| go-pretty | Output beautiful command line tables, text, progress bars | https://github.com/jedib0t/go-pretty |
| progressbar | Thread-safe command line progress bar | https://github.com/schollz/progressbar |
| go-ansi | Windows portable ANSI escape sequence utility for Go language | https://github.com/k0kubun/go-ansi |
| go-isatty | Library for determining tty | https://github.com/mattn/go-isatty |
Compression & Decompression
| Name | Description | Repository |
|---|---|---|
| klauspost/compress | Optimization and modification of compress standard library | https://github.com/klauspost/compress |
| alexmullins/zip | Fork branch of archive/zip standard library with password support | https://github.com/alexmullins/zip |
| mholt/archiver | Compression and decompression tool library supporting many formats (personally highly recommended) | https://github.com/mholt/archiver |
| go-car | CAR archive file implementation in Go | https://github.com/ipld/go-car |
| go-unarr | A compression and decompression library | https://github.com/gen2brain/go-unarr |
| xz | Pure Golang library for reading and writing xz compressed files | https://github.com/ulikunitz/xz |
Date & Time
| Name | Description | Repository |
|---|---|---|
| carbon | Time and date processing library | https://github.com/golang-module/carbon |
| robfig/cron | Scheduled task library | https://pkg.go.dev/github.com/robfig/cron/v3 |
| gron | Scheduled task library | https://github.com/roylee0704/gron |
| jobrunner | Asynchronous scheduled task framework | https://github.com/bamzi/jobrunner |
| dataparse | Can parse time strings without knowing the format | https://github.com/araddon/dateparse |
| jinzhu/now | Date utility library | https://github.com/jinzhu/now |
Dependency Injection
| Name | Description | Repository |
|---|---|---|
| dig | Dependency injection library open sourced by uber, based on reflection | https://darjun.github.io/2020/02/22/godailylib/dig/ |
| wire | Dependency injection library open sourced by Google, based on code generation | https://github.com/google/wire |
| inject | Dependency injection tool | https://github.com/codegangsta/inject |
| di | Dependency injection container | https://github.com/sarulabs/di |
Geographic Location
| Name | Description | Repository |
|---|---|---|
| geoip2-golang | IP to geographic information | https://github.com/oschwald/geoip2-golang |
| ip2location-go | IP to geographic information | https://github.com/ip2location/ip2location-go |
Web Scraping Frameworks
| Name | Description | Repository |
