The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Choose an AI assistant to explain this destination using its public sources. Gemini opens gemini.google.com. Gemini, Copilot, DeepSeek, Meta AI and Qwen require pasting the prompt below; the other links include it in their URL. Sign-in or a manual paste may still be required. Check the answer against the documentation.
Copy the plain-text prompt
Use the code block's copy control, or select its complete text, then paste it into your assistant.
Help me understand QR Code & Barcode Scanner for Go (bindings/go/README.md) for QR Code & Barcode Scanner, the open-source scanner. Source documentation; publication is not implied. Provided README context (verify against the sources): Use the Go adapter in an existing Go service, batch job or command that can start a local process. Install qrscan separately and keep its version compatible with the adapter. The adapter forwards the engine report rather than translating identifiers into numbers, which matters for barcode values with leading zeroes. Read the public documentation below. Explain what this destination does, its documented installation or access steps, a minimal example if supported, prerequisites, limitations and license. Distinguish published packages from working source and preparation. Cite your sources; if a page is unavailable or a fact cannot be checked, say so. Do not invent installation commands, benchmark results or comparisons. Answer in my language. Public sources: https://github.com/qrcode-ai-com/qrcode-barcode-scanner-rust/blob/main/bindings/go/README.md https://qrcode-ai.com/en-US/qr-code-scanner https://qrcode-ai.com/en-US/barcode-scanner https://qrcode-ai.com/en-US/qr-code-scanner/sdk/go https://qrcode-ai.com/en-US/barcode-scanner/sdk/go https://qrcode-ai.com/en-US/qr-code-generator https://qrcode-ai.com/en-US/barcode-generator
Use the Go adapter in an existing Go service, batch job or command that can start a local process. Install qrscan separately and keep its version compatible with the adapter. The adapter forwards the engine report rather than translating identifiers into numbers, which matters for barcode values with leading zeroes.
The QR code scanner and barcode scanner are QR Code AI’s browser scanning entry points. For the corresponding development route, the QR code scanner Go guide and barcode scanner Go guide connect this documentation to the two product journeys. If a product page is unavailable, the instructions and references in this README remain the starting point for this source directory.
To prepare a zero-prefixed reference for a Go import test, use the QR code generator or the barcode generator. Keep the original payload with the exported image so that you can compare the scan result with the value you intended to encode.
Read QR codes and barcodes from an image file in Go. This package drives the installed qrscan
command of the
QR Code & Barcode Scanner engine
and returns its JSON report unchanged. It holds no decoder of its own, uses the standard library
only and needs no cgo.
How it works
The picture shows the three steps. Your code passes the path of an image file, the installed
qrscan command reads its codes, and your code reads the JSON report it returns. The next
sections follow that order: install the package and qrscan, scan an image, then read the
report.
Install
go get github.com/qrcode-ai-com/qrcode-barcode-scanner-go@v0.12.3
The package follows the engine it drives: version 0.12.x of the package works with qrscan
0.12.x. The first version is 0.11.0.
What you need
Go 1.24 or later. CGO_ENABLED=0 works: there is no C code.
The qrscan command, version 0.12.x, installed separately. The
distribution guide lists the routes: Homebrew, Scoop, the
Debian and RPM packages, the AUR, cargo install, the release archives and the container
image. This package never downloads it.
Install qrscan from the channel your system already uses:
scanner := qrscan.New("") // qrscan on PATH; or qrscan.New("/path/to/qrscan")
report, err := scanner.Scan(ctx, "label.png", qrscan.Fast, qrscan.ProfileBudget)
if err != nil {
return err
}
for _, detection := range report.Detections {
fmt.Println(detection.Symbology, detection.Text)
}
Scan takes a context, the file, a profile and a time budget in milliseconds:
Profile
What the engine does
qrscan.Frame
Decodes only. The report carries no score.
qrscan.Fast
Decodes first, with a reduced judgment.
qrscan.Full
Decodes and judges how well a QR code scans.
qrscan.ProfileBudget keeps the profile's own budget, and a busy machine can then cut the scan
short. qrscan.Unbounded sets none: the result then does not depend on how busy the machine is.
Cancelling the context stops the command.
Read the report
The picture is a recorded scan of one image that holds a QR code and a Code 128 barcode. Both come
back in the same report, each with its format and the place where the engine measured it.
report.JSON is the exact text the engine printed. Nothing is renamed, rounded or recalculated,
so decode it yourself for the payload, the measured places and the trace. The other fields read
the most used parts:
Field
Meaning
Found()
At least one code was decoded.
Detections
One entry per distinct content: Symbology, Text and Raw, the exact bytes.
Score
The scannability judgment, or nil.
Complete
false when the time budget cut the scan.
EngineVersion
The engine that wrote the report, such as 0.11.0.
Three things are easy to get wrong:
No code is a result, not an error.Found() is false and err is nil.
A missing score is not zero.Score is nil with qrscan.Frame, or when the budget ran
out before the judgment.
An incomplete scan proves nothing. When Complete is false, an empty report does not
mean the image holds no code. Scan again with a larger budget or with qrscan.Unbounded.
Decoded text is untrusted data: a QR code can hold any text. Do not follow its links or run it.
What it reads
The package returns the report of the qrscan command you installed, so it reads what that engine reads.
Codes of different formats in the same image come back in one report.
qrscan could not be started: not installed, not on PATH, not executable. It is not remembered: install the command and the same Scanner works.
*qrscan.UnsupportedVersionError
The installed qrscan is not 0.12.x. The check runs before the first scan.
*qrscan.ScanError
The engine refused the file or the options. EngineCode holds its code when it gives one, such as QRS-001 for a file that is not an image.
the context's error
The context was cancelled or its deadline passed; the command was stopped.
What it does and does not do
One scan starts one process. That suits a request or a job. It is the wrong tool for
thousands of images in a tight loop.
It reads image files: PNG, JPEG, WebP and GIF. To scan bytes you hold in memory, write them
to a temporary file first.
The command is started from a list of arguments, with no shell. A file name is never
interpreted, whatever it holds: spaces, quotes, a leading dash or shell characters.
It writes nothing, fetches nothing and never opens what a code points to.
Why not WebAssembly
A first experiment compiled the engine to WebAssembly and ran it inside the Go process with
wazero. Its reports were identical to the native command's, and one scan of a photo-sized image
took about twenty times longer. The owner chose this route on 11 November 2026.
Develop
The tests run against a real qrscan, not a stand-in:
QRSCAN_BINARY=/path/to/qrscan QRSCAN_FIXTURES=/path/to/engine/fixtures go test ./...
They cover the three profiles on an image that holds a QR code and a Code 128, an image with no
code, files that are not images, awkward file names, a missing command, an engine of another
version and a cancelled context. The workflow Go adapter of the engine repository runs them
on Linux, macOS and Windows against the released command.
The Rust, Node.js, browser and Python packages hold the engine. The Go and PHP packages hold no decoder:
each one starts qrscan and hands you its report.
Language and platform names and logos belong to their owners. They identify a runtime or a destination and imply no endorsement.
Its own repository
A Go module is fetched from the root of a repository at a tag, so the package is served from a
small repository of its own, qrcode-ai-com/qrcode-barcode-scanner-go. Nothing there is edited
by hand: scripts/stage-go-package.py writes its whole tree
from one commit of the engine repository, with the workflow of mirror/, the two test
images, the licence and a SOURCE.json that names the commit and the sha256 of every file. The
same program checks that a tree is exactly that. Change the package here, then stage it again.
Licence
Project-authored adapter source is MIT; see LICENSE. The separately
installed engine retains the license of its exact installed version.
Maintained by Thibaut Mélen & Nicolas Cella for QR Code AI, a product of SuperNovae Studio. The license of each component is stated in its own license files.
Source license
Project-authored scanner code and documentation in this checkout are available under the MIT License. You may use, modify and redistribute this source in open-source or proprietary applications, including commercial products, while preserving the copyright and permission notice. Thibaut Mélen & Nicolas Cella develop QR Code AI at SuperNovae Studio.
Retained third-party code, dependencies, artwork and test data keep their own licenses and notices. The licensing guide explains these component boundaries; the project license does not assign a license to an unrelated platform or service.
Published archives retain the license shipped with their version. A pinned engine, adapter or bundle may therefore have different terms from this working source. Read its packaged license and the license history before reuse. The source change does not replace an archive or publish a new version.
Package qrscan reads QR codes and barcodes from an image file through the installed qrscan
command of the QR Code & Barcode Scanner engine.
The package holds no decoder. It starts the command, which you install separately, and
returns its JSON report unchanged. One scan is one process. The command is started from a
list of arguments, with no shell: a file name is never interpreted, whatever it holds. The
package uses the standard library only, with no cgo.
scanner := qrscan.New("") // qrscan on PATH
report, err := scanner.Scan(ctx, "label.png", qrscan.Fast, qrscan.ProfileBudget)
for _, detection := range report.Detections {
fmt.Println(detection.Symbology, detection.Text)
}
const (
// ProfileBudget keeps the profile's own budget. ProfileBudget = -1
// Unbounded sets no budget: the result then does not depend on how busy the machine is. Unbounded = 0
)
type Detection struct {
// Symbology is the kind of code, such as qr_code or code128. Symbology string// Text is the decoded text. Treat it as untrusted data: a QR code can hold any text. Text string// Raw is the exact bytes of the content, for content that is not text. Raw []byte
}
Detection is one decoded content. The full entry, with its payload and measured places, is
in Report.JSON.
Profile says how much work one scan does. The values are the ones `qrscan --profile` takes.
const (
// Full decodes and judges how well a QR code scans. Full Profile = "full"
// Fast decodes first, with a reduced judgment. Fast Profile = "fast"
// Frame decodes only: the report carries no score. Frame Profile = "frame"
)
type Report struct {
// JSON is the engine's report, exactly as printed. JSON []byte// ExitCode is 0 when qrscan found a code and 1 when it found none. ExitCode int// Detections holds one entry per distinct content. Detections []Detection// Score is nil when the engine made no judgment: the frame profile, or a budget that ran// out. Nil is never zero.
Score *Score// Complete is false when the time budget cut the scan: an empty report then proves nothing. Complete bool// EngineVersion is the engine that wrote the report, such as 0.11.0. EngineVersion string
}
Report is one scan report. JSON is the text the engine printed, unchanged: nothing is
renamed, rounded or recalculated. The other fields only read it. A report with no detection
is a valid result, not an error.
type ScanError struct {
// ExitCode is the command's exit code. ExitCode int// EngineCode is the engine's own code, such as QRS-001 for a file that is not an image.// It is empty when the message carries none.
EngineCode string// Message is one line of the command's own message. Message string
}
ScanError means the engine refused the file or the options, or its output could not be read.
EngineVersion returns the version of the installed engine, such as 0.11.0. It fails with
UnsupportedVersionError when that version is outside the supported line.
Scan reads the codes of one image file (PNG, JPEG, WebP or GIF). budgetMs is ProfileBudget,
Unbounded or a number of milliseconds. Cancelling ctx stops the command.