nghttp2 C ライブラリを Go から呼び出して HTTP/2 Web サーバーを書いたという記事です. ソースコードは https://github.com/tatsuhiro-t/go-nghttp2 にあります. Go から nghttp2 の API を呼び出すために cgo を使いました. session.go が nghttp2 API をラップしている部分です. cgo の標準的な書き方で, import "C" の上に CFLAGS やら include やらを書いておきます. // #cgo CFLAGS: -O2 // #cgo LDFLAGS: -lnghttp2 // #include <string.h> // #include <nghttp2/nghttp2.h> // #include "cnghttp2.h" import "C" 現在 cgo では