# hqr **Repository Path**: honsty0113/hqr ## Basic Information - **Project Name**: hqr - **Description**: 二维码 - **Primary Language**: Go - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2016-12-26 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # hqr 二维码 ## 示例 ``` package main import ( "github.com/honsty/hqr" "net/http" ) func main() { http.HandleFunc("/qr", Qr) http.ListenAndServe(":8080", nil) } func Qr(w http.ResponseWriter, r *http.Request) { r.ParseForm() text := r.URL.Query().Get("text") code, err := hqr.Encode(text, hqr.H) if err != nil { w.Write([]byte("Server Error.")) return } w.Header().Set("Content-Type", "image/png") w.Write(code.PNG()) } ```