Go 开源ライブラリ大全
いくつかのオープンソース Go サードパーティライブラリとフレームワークを収集し、整理・分類して、後続の閲覧を容易にします。新しいプロジェクトの PR 提出も歓迎します。
TIP
先后順序不代表排名,好不好用要根据实际体验来看。
Web フレームワーク
| 名前 | 説明 | リポジトリ |
|---|---|---|
| gin | 最もクラシックな web フレームワーク | https://github.com/gin-gonic/gin |
| beego | 中国人が開発した web フレームワーク | https://github.com/beego/beego |
| iris | 最速を謳う web フレームワーク | https://github.com/kataras/iris |
| echo | 極簡で高性能な web フレームワーク | https://github.com/labstack/echo |
| goji | 简洁な web フレームワーク | https://github.com/zenazn/goji |
| revel | 高可用性のフルスタック web フレームワーク | https://github.com/revel/revel |
| buffalo | シンプルにフルスタックプロジェクトを構築できる web フレームワーク | https://github.com/gobuffalo/buffalo |
| hertz | 高性能と高拡張性を備えたマイクロサービス HTTP フレームワーク(ByteDance 开源) | https://github.com/cloudwego/hertz |
| dotweb | シンプルなミニマル web フレームワーク | https://github.com/devfeel/dotweb |
| fiber | Node.js Express スタイルの Web フレームワーク | https://github.com/gofiber/fiber |
ORM
| 名前 | 説明 | リポジトリ |
|---|---|---|
| gorm | 開発者フレンドリーな ORM ライブラリ | https://github.com/go-gorm/gorm |
| xorm | シンプルで強力な ORM | https://gitea.com/xorm/xorm |
| ent | Facebook 开源の ORM | https://github.com/ent/ent |
| sqlx | sql ライブラリの強力な拡張 | https://github.com/jmoiron/sqlx |
| beego/orm | beego 標準搭載の orm | https://github.com/astaxie/beego/tree/master/orm |
| rel | 拡張可能なモダン ORM | https://github.com/go-rel/rel |
| bun | SQL 優先の ORM | https://github.com/uptrace/bun |
マイクロサービスフレームワーク
| 名前 | 説明 | リポジトリ |
|---|---|---|
| kratos | クラウドネイティブマイクロサービスフレームワーク(Bilibili 开源) | https://github.com/go-kratos/kratos |
| go-kit | マイクロサービス開発のためのツールライブラリ | https://github.com/go-kit/kit |
| kitex | 高性能と高拡張性を備えたマイクロサービスフレームワーク(ByteDance 开源) | https://github.com/cloudwego/kitex |
| go-zero | クラウドネイティブマイクロサービスフレームワーク(七牛云开源) | https://github.com/zeromicro/go-zero |
| go-micro | 海外のマイクロサービスフレームワーク | https://github.com/go-micro/go-micro |
| kite | マイクロサービスフレームワーク(長期間更新なし) | https://github.com/koding/kite |
| dubbo-go | Java dubbo の Go 実装(アリババ开源) | https://github.com/apache/dubbo-go |
| tarsgo | tars の Go 実装(テンセント开源) | https://github.com/TarsCloud/TarsGo |
| juptiers | ガバナンス指向のマイクロサービスフレームワーク(斗鱼开源) | https://github.com/douyu/jupiter |
| redsync | redis 分散ロック | https://github.com/go-redsync/redsync |
彩蛋
斗鱼の jupiter はゼウスの名前であり、神々の王です。一方、B 站の kratos は戦神クレイトスの名前で、クレイトスは後に神々の王ゼウスを殺しました。
ログコンポーネント
| 名前 | 説明 | リポジトリ |
|---|---|---|
| logrus | 構造化ログライブラリ | https://github.com/sirupsen/logrus |
| zap | uber 开源の高性能ログライブラリ | https://github.com/uber-go/zap |
| glog | 階層別実行ログ | https://github.com/golang/glog |
| zerolog | ゼロメモリ割り当ての json ログ | https://github.com/rs/zerolog |
| apex/log | 構造化ログライブラリ | https://github.com/apex/log |
| lumberjack | ログ分割ライブラリ、サイズ分割、日付分割、ファイル圧縮をサポート | https://github.com/natefinch/lumberjack |
テストコンポーネント
| 名前 | 説明 | リポジトリ |
|---|---|---|
| testify | 最も人気なテストツールキット | https://github.com/stretchr/testify |
| ginkgo | モダンなテストフレームワーク | https://github.com/onsi/ginkgo |
| ramsql | メモリベースの SQL エンジン、主に SQL の単体テスト用 | https://github.com/proullon/ramsql |
| go-sqlmock | テスト用の SQL Mock | https://github.com/DATA-DOG/go-sqlmock |
| goconvey | ブラウザで可視化テスト | https://github.com/smartystreets/goconvey |
| go-stress-testing | 負荷テストツール | https://github.com/link1st/go-stress-testing |
| xgo | Go 打桩テストフレームワーク、コンパイル時にコードを重写して実装 | https://github.com/xhd2015/xgo |
| gomonkey | Go 打桩テストフレームワーク、関数アドレスを変更して実装 | https://github.com/agiledragon/gomonkey |
データ処理
| 名前 | 説明 | リポジトリ |
|---|---|---|
| mapstructure | map と構造体の相互変換 | https://github.com/mitchellh/mapstructure |
| cast | データ型変換を簡単に行える | https://github.com/spf13/cast |
| deepcopy | 深層コピー | https://github.com/mohae/deepcopy |
| copier | 構造体間で同名フィールドの値をコピー | https://github.com/jinzhu/copier |
| go-pinyin | 漢字を拼音に変換 | https://github.com/mozillazg/go-pinyin |
| go-streams | ストリーム形式のデータ処理 | https://github.com/reugn/go-streams |
| stream | ストリーム処理 | https://github.com/xyctruth/stream |
| go-humanize | データを人間が読める形式に変換 | https://github.com/dustin/go-humanize |
| uniseg | Go で Unicode テキストセグメンテーション、ワードラッピング、文字列幅計算 | https://github.com/rivo/uniseg |
データ検証
| 名前 | 説明 | リポジトリ |
|---|---|---|
| go-playground/validator/v10 | データ検証器 | https://github.com/go-playground/validator |
| go-cmp | グーグル开源の値比較ライブラリ | https://github.com/google/go-cmp |
| ozzo-validation | ルールベースのデータ検証ライブラリ | https://github.com/go-ozzo/ozzo-validation |
| go-tagexpr | 構造体 tag 検証ライブラリ | https://github.com/bytedance/go-tagexpr |
データ構造
| 名前 | 説明 | リポジトリ |
|---|---|---|
| gods | 一般的なデータ構造の実装 | https://github.com/emirpasic/gods |
| go-datastructures | 一般的なデータ構造の実装 | https://github.com/Workiva/go-datastructures |
| biset | Go での bitsets の実装 | https://github.com/bits-and-blooms/bitset |
| bloom | Go での bloom filters の実装 | https://github.com/bits-and-blooms/bloom |
| deque | 高性能双端キューの実装 | https://github.com/edwingeng/deque |
| concurrent-map | 並行安全なシャード map 実装 | https://github.com/orcaman/concurrent-map |
| samber/lo | Lodash スタイルのデータ処理ライブラリ、ジェネリクス対応 | https://github.com/samber/lo |
| google/btree | グーグル実装の BTree ライブラリ、ジェネリクス対応 | https://github.com/google/btree |
| gostl | C++ STL のようなデータ構造ライブラリ | https://github.com/liyue201/gostl |
数学計算
| 名前 | 説明 | リポジトリ |
|---|---|---|
| gonum | numpy に相当する | https://github.com/gonum/gonum |
| decimal | 高精度浮動小数点演算ライブラリ | https://github.com/shopspring/decimal |
| crunch | バイトとビット演算を簡素化するライブラリ | https://github.com/superwhiskers/crunch |
| math-engine | 数学式解析計算エンジンライブラリ | https://github.com/dengsgo/math-engine |
テンプレートエンジン
| 名前 | 説明 | リポジトリ |
|---|---|---|
| pongo2 | Django スタイルのテンプレートエンジン | https://github.com/flosch/pongo2 |
| ace | html テンプレートエンジン | https://github.com/yosssi/ace |
| mustache | mustache の Go 実装 | https://github.com/hoisie/mustache |
| hero | 機能豊富で高速なテンプレートエンジン | https://github.com/shiyanhui/hero |
| quicktemplate | 高性能テンプレートエンジン | https://github.com/valyala/quicktemplate |
| amber | HAML と Jade に由来するテンプレートエンジン | https://github.com/eknkc/amber |
キャッシュコンポーネント
| 名前 | 説明 | リポジトリ |
|---|---|---|
| golang-lru | スレッドセーフな LRU、および LRU 2Q キャッシュ | https://github.com/hashicorp/golang-lru |
| ttlcache | メモリベースのキャッシュ、TTL、ジェネリクス対応 | https://github.com/jellydator/ttlcache |
| gocache | キャッシュミドルウェアマネージャー | https://github.com/eko/gocache |
| go-cache | メモリベースのキャッシュ、シングルマシンアプリケーション用、TTL 対応 | https://github.com/patrickmn/go-cache |
| ristretto | 高性能メモリキャッシュ | https://github.com/dgraph-io/ristretto |
| bigcache | メモリベースの高效率な大規模 key キャッシュ | https://github.com/allegro/bigcache |
データベース&ドライバー
シリアライゼーション
| 名前 | 説明 | リポジトリ |
|---|---|---|
| go-ini | ini ファイルシリアライゼーションライブラリ | https://github.com/go-ini/ini |
| sonic | 字节开源の高性能 json シリアライゼーションライブラリ | https://github.com/bytedance/sonic |
| easyjson | json 高速シリアライゼーションライブラリ | https://github.com/mailru/easyjson |
| gjson | json キー値の高速取得、非伝統的シリアライゼーションライブラリ | https://github.com/tidwall/gjson |
| go-yaml | yaml シリアライゼーションライブラリ | https://github.com/go-yaml/yaml |
| go-toml | toml シリアライゼーションライブラリ | https://github.com/pelletier/go-toml |
| properties | properties シリアライゼーションライブラリ | https://github.com/magiconair/properties |
| viper | 複数データフォーマット対応シリアライゼーション、設定マネージャー | https://github.com/spf13/viper |
| configor | gorm 作者が書いた複数データフォーマットシリアライザー、設定マネージャー | https://github.com/jinzhu/configor |
コマンドライン
| 名前 | 説明 | リポジトリ |
|---|---|---|
| pflag | POSIX/GUN スタイルの flag パッケージ | https://github.com/spf13/pflag |
| go-flags | コマンド引数解析器 | https://github.com/jessevdk/go-flags |
| cobra | モダンなコマンドラインプログラム構築スキャフォールド | https://github.com/spf13/cobra |
| dimiro1/banner | 美しいバナー構築ライブラリ | https://github.com/dimiro1/banner |
| go-pretty | 美しいコマンドラインテーブル、テキスト、プログレスバー出力 | https://github.com/jedib0t/go-pretty |
| progressbar | スレッドセーフなコマンドラインプログレスバー | https://github.com/schollz/progressbar |
| go-ansi | Go 言語用 Windows 移植 ANSI エスケープシーケンスユーティリティ | https://github.com/k0kubun/go-ansi |
| go-isatty | tty 判定ライブラリ | https://github.com/mattn/go-isatty |
圧縮・解凍
| 名前 | 説明 | リポジトリ |
|---|---|---|
| klauspost/compress | compress 標準ライブラリの最適化改造 | https://github.com/klauspost/compress |
| alexmullins/zip | archive/zip 標準ライブラリの fork ブランチ、パスワード対応 | https://github.com/alexmullins/zip |
| mholt/archiver | 多数フォーマット対応の圧縮・解凍ツールライブラリ(個人非常におすすめ) | https://github.com/mholt/archiver |
| go-car | CAR アーカイブファイルの Go 実装 | https://github.com/ipld/go-car |
| go-unarr | 圧縮・解凍ライブラリ | https://github.com/gen2brain/go-unarr |
| xz | xz 圧縮ファイルの読み書き用純粋 Golang ライブラリ | https://github.com/ulikunitz/xz |
日時処理
| 名前 | 説明 | リポジトリ |
|---|---|---|
| carbon | 日時処理ライブラリ | https://github.com/golang-module/carbon |
| robfig/cron | 定时タスクライブラリ | https://pkg.go.dev/github.com/robfig/cron/v3 |
| gron | 定时タスクライブラリ | https://github.com/roylee0704/gron |
| jobrunner | 非同期定时タスクフレームワーク | https://github.com/bamzi/jobrunner |
| dateparse | フォーマット不明でも日時文字列を解析可能 | https://github.com/araddon/dateparse |
| jinzhu/now | 日時ツールライブラリ | https://github.com/jinzhu/now |
依存注入
| 名前 | 説明 | リポジトリ |
|---|---|---|
| dig | uber 开源の依存注入ライブラリ、リフレクションベース | https://darjun.github.io/2020/02/22/godailylib/dig/ |
| wire | グーグル开源の依存注入ライブラリ、コード生成ベース | https://github.com/google/wire |
| inject | 依存注入ツール | https://github.com/codegangsta/inject |
| di | 依存注入コンテナ | https://github.com/sarulabs/di |
地理位置
| 名前 | 説明 | リポジトリ |
|---|---|---|
| geoip2-golang | IP 地理位置情報 | https://github.com/oschwald/geoip2-golang |
| ip2location-go | IP 地理位置情報 | https://github.com/ip2location/ip2location-go |
クローラーフレームワーク
| 名前 | 説明 | リポジトリ |
|---|---|---|
| colly | シンプルで強力なクローラーフレームワーク | https://github.com/gocolly/colly |
| goquery | j-query に類似 | https://github.com/PuerkitoBio/goquery |
ネットワークツール
| 名前 | 説明 | リポジトリ |
|---|---|---|
| gentleman | プラグイン駆動、拡張可能な http クライアント | https://github.com/h2non/gentleman |
| resty | restful http クライアント | https://pkg.go.dev/github.com/go-resty/resty/v2 |
| gopeed | 全プラットフォーム対応のモダンダウンロードマネージャー、Go と flutter ベース | https://github.com/GopeedLab/gopeed |
電子メール
| 名前 | 説明 | リポジトリ |
|---|---|---|
| jordan-wright/email | 堅牢で柔軟なメール送信ライブラリ | https://github.com/jordan-wright/email |
| gomail | メール送信ライブラリ | https://github.com/go-gomail/gomail |
| go-simple-mail | シンプルなメール送信ライブラリ | https://github.com/xhit/go-simple-mail |
| go-mail | 使いやすく包括的なメール送信ライブラリ | https://github.com/wneessen/go-mail |
| email-verifier | メールアドレス有効性検証、メール送信不要 | https://github.com/AfterShip/email-verifier |
| maddy | 組合せ式メールサーバー | https://github.com/foxcpp/maddy |
| mox | 全面的オープンソース、高メンテナンス性、自ホスト型メールサーバー | https://github.com/mjl-/mox |
| hermes | メールテンプレート生成ライブラリ | https://github.com/matcornic/hermes |
| listmonk | 高性能、自ホスト、可視化メールリスト管理 | https://github.com/knadh/listmonk |
| go-smtp | Go 実装の SMTP クライアントとサーバー | https://github.com/emersion/go-smtp |
| go-imap | Go 実装の IMAP クライアントとサーバー | https://github.com/emersion/go-imap |
ゲーム開発
| 名前 | 説明 | リポジトリ |
|---|---|---|
| ebitengine | 非常にシンプルな 2d ゲームエンジン | https://github.com/hajimehoshi/ebiten |
| Azul3D | Go で記述された 3d ゲームエンジン | https://github.com/azul3d/engine |
| engo | Go で記述されたオープンソース 2d ゲームエンジン | https://github.com/EngoEngine/engo |
| g3n/engine | Go 3d ゲームエンジン | https://github.com/g3n/engine |
| gonet | ゲームサーバーフレームワーク | https://github.com/xtaci/gonet |
| leaf | ゲームサーバーフレームワーク | https://github.com/name5566/leaf |
| cloud-game | Web ベースのクラウドゲームサービス | https://github.com/giongto35/cloud-game |
GUI
| 名前 | 説明 | リポジトリ |
|---|---|---|
| fyne | クロスプラットフォーム GUI 開発ツールキット(本当に何かある) | https://github.com/fyne-io/fyne |
| go-flutter | Go で flutter を記述 | https://github.com/go-flutter-desktop/go-flutter |
| Wails | Go の高速かつ軽量な Electron 代替品と見なせる | https://github.com/wailsapp/wails |
システム対話
| 名前 | 説明 | リポジトリ |
|---|---|---|
| gopsutil | OS 情報取得、主要システム対応 | https://github.com/shirou/gopsutil |
| flock | OS 呼び出しベースのファイルロック | https://github.com/gofrs/flock |
| sys | 公式 OS 対話ライブラリ | https://cs.opensource.google/go/x/sys |
言語間対話
| 名前 | 説明 | リポジトリ |
|---|---|---|
| gopher-lua | Go 実装の lua 仮想機 | https://github.com/yuin/gopher-lua |
| go-lua | Go 実装の lua 仮想機 | https://github.com/Shopify/go-lua |
| goja | es5.1+ 対応 | https://github.com/dop251/goja |
| tengo | Tengo は小型、動的、高速、安全な Go スクリプト言語 | https://github.com/d5/tengo |
| goby | ruby に触発され、Go で実装された解釈型スクリプト言語 | https://github.com/goby-lang/goby |
| go+ | 七牛云开源のスクリプト言語、Go とシームレス対話可能、Q 言語とも呼ばれる | https://github.com/goplus/gop |
| go-python | Go から cpython2 を呼び出す | https://github.com/sbinet/go-python |
| go-python3 | Go から cpython3 を呼び出す | https://github.com/DataDog/go-python3 |
画像処理
| 名前 | 説明 | リポジトリ |
|---|---|---|
| plot | プロットライブラリ、主にデータ可視化用 | https://github.com/gonum/plot |
| gg | 2d 描画ライブラリ | https://github.com/fogleman/gg |
| gocv | opencv4+ 対応 | https://github.com/hybridgroup/gocv |
| imaging | シンプルな画像処理ライブラリ | https://github.com/disintegration/imaging |
テキスト処理
| 名前 | 説明 | リポジトリ |
|---|---|---|
| vale | 文法認識テキスト校正ツール | https://github.com/errata-ai/vale |
認証認可
| 名前 | 説明 | リポジトリ |
|---|---|---|
| casbin | 柔軟で強力な権限管理ライブラリ | https://github.com/casbin/casbin |
| openfga | 高性能権限/認可ライブラリ、Google Zanzibar 由来 | https://github.com/openfga/openfga |
コード生成
| 名前 | 説明 | リポジトリ |
|---|---|---|
| jennifer | コード生成ライブラリ | https://github.com/dave/jennifer |
正規表現処理
| 名前 | 説明 | リポジトリ |
|---|---|---|
| commonregx | 一般的な正規表現コレクションライブラリ | https://github.com/mingrammer/commonregex |
ファイル処理
| 名前 | 説明 | リポジトリ |
|---|---|---|
| filebox | ファイル操作ツールライブラリ | https://github.com/dstgo/filebox |
| size | ファイルサイズと文字列間の高速変換 | https://github.com/dstgo/size |
| checksum | ファイルハッシュ署名計算ライブラリ | https://github.com/codingsince1985/checksum |
| pdfcpu | pdf プロセッサ | https://github.com/pdfcpu/pdfcpu |
| unioffice | office 処理ライブラリ | https://github.com/unidoc/unioffice |
| gooxml | office 処理ライブラリ | https://github.com/carmel/gooxml |
| pdfcpu | PDF 処理ライブラリ | https://github.com/pdfcpu/pdfcpu |
| excelize | Excel 処理ライブラリ | https://github.com/360EntSecGroup-Skylar/excelize |
汎用ツール
| 名前 | 説明 | リポジトリ |
|---|---|---|
| lancet | 多機能ツールライブラリ、Java の common パッケージに相当 | https://github.com/duke-git/lancet |
| bytebufferpool | バイトバッファプール | https://github.com/valyala/bytebufferpool |
開発フレームワーク
| 名前 | 説明 | リポジトリ |
|---|---|---|
| goframe | モダン企業級 Go 開発フレームワーク | https://github.com/gogf/gf |
コンセンサスプロトコル
| 名前 | 説明 | リポジトリ |
|---|---|---|
| hashicorp/raft | consul 开源の raft ライブラリ | https://github.com/hashicorp/raft |
| hashicorp/memberlist | consul 开源の gossip ライブラリ | https://github.com/hashicorp/memberlist |
| etcd-io/raft | etcd 开源の raft ライブラリ | https://github.com/etcd-io/raft |
OCR
| 名前 | 説明 | リポジトリ |
|---|---|---|
| gosseract | Tesseract C++ ライブラリ使用の OCR ライブラリ | https://github.com/otiai10/gosseract |
