MinIO Go Client SDK: Go Library for S3 Storage
MinIO Go Client SDK is the official Go library for talking to MinIO and other Amazon S3 compatible object storage over its own API rather than the AWS SDK. It wraps bucket and object calls — including MinIO-only extensions like ListenNotification — behind a single minio.Client struct. Reach for it if you're writing Go against MinIO or generic S3-compatible storage; skip it if you specifically need AWS's own SDK for services beyond S3 itself.
What is the MinIO Go Client SDK?
MinIO Go Client SDK is a Go library that gives programs straightforward APIs for working with any Amazon S3 compatible object storage service, per its own README. It's distributed as github.com/minio/minio-go/v7 and installed with `go get`, and it wraps everything — buckets, objects, presigned URLs, bucket policies and notifications — behind a minio.Client you initialize once with an endpoint and credentials.
Installing the MinIO Go Client
Installation is a single command: `go get github.com/minio/minio-go/v7`, run from your project directory — the README assumes you already have a working Go development environment set up. There's no separate config file or credentials bootstrap step documented for the SDK itself; you build a `minio.Client` in code by passing an endpoint and a `minio.Options` struct with credentials (the README shows `credentials.NewStaticV4` for a static access key and secret) and a `Secure` flag for TLS. The full API reference lives at pkg.go.dev (godoc) and at MinIO's own Go Client API Reference page, not inline in the repo.
Uploading Files with Go
The README's canonical example connects to `play.min.io` — MinIO's public test cluster, which the README warns should be treated as public and non-protected for anything uploaded there — using a hardcoded static access key and secret. From there it's four calls: build the client with `minio.New`, call `MakeBucket` (falling back to a `BucketExists` check if the bucket already exists, since re-running the example a second time would otherwise error), then `FPutObject` to push a local file straight from disk with a `ContentType` set, which returns an `info.Size` you can log to confirm the upload. The counterpart for downloads, `FGetObject`, pulls a remote object straight to a local file path the same way. Verification in the example happens outside Go entirely, via `mc ls play/testbucket` on the command line.
Key Capabilities for Object Storage
- ✓Bucket operations covering the full lifecycle — MakeBucket, ListBuckets, BucketExists, RemoveBucket, ListObjects, and ListIncompleteUploads.
- ✓Object operations for everyday transfer and management: GetObject, PutObject, PutObjectStreaming, StatObject, CopyObject, RemoveObject, and a batch RemoveObjects call.
- ✓File-based helpers, FPutObject and FGetObject, that move a local file straight to or from a bucket without you handling io.Reader plumbing yourself.
- ✓Presigned URL generation — PresignedGetObject, PresignedPutObject, PresignedHeadObject, and PresignedPostPolicy — for handing out time-limited access without exposing credentials.
- ✓Bucket policy and notification management (SetBucketPolicy, SetBucketNotification, and related calls), plus examples covering bucket lifecycle, encryption, and replication settings.
- ✓Two operations the README flags explicitly as MinIO Extensions rather than standard S3: ListenBucketNotification and ListenNotification, for streaming bucket events.
- ✓SelectObjectContent for running queries against object content server-side, alongside object-annotation calls (PutObjectAnnotation, GetObjectAnnotation, ListObjectAnnotations, RemoveObjectAnnotation).
- ✓Request tracing via TraceOn/TraceOff and app identification via SetAppInfo, both listed under the SDK's client custom-settings API.
Strengths
- ✓One client struct, `minio.Client`, covers buckets, objects, policies, notifications, and presigned URLs — no separate client per feature area.
- ✓File-to-object and object-to-file helpers (FPutObject/FGetObject) mean common upload/download code doesn't require manual io.Reader handling.
- ✓Every operation category in the README — bucket, object, policy, notification, encryption, lifecycle, replication, presigned — ships with a linked, runnable example file in the repo.
- ✓Apache-2.0 licensing keeps it free of copyleft obligations for use inside a proprietary Go application.
- ✓Works against any S3-compatible endpoint per the README, not locked to MinIO servers for its standard, non-extension operations.
Compatibility and MinIO Extensions
- △Two documented calls — ListenBucketNotification and ListenNotification — are explicitly labeled MinIO Extension in the README, meaning code using them won't necessarily work unmodified against plain Amazon S3 or other S3-compatible backends.
- △The README's own quickstart only covers install, client setup, and a single file-upload walkthrough; the full method list lives off-repo at pkg.go.dev and MinIO's own API reference page rather than in the repository itself.
- △No SDK version number, changelog, or release cadence is stated in the README — the only version marker visible is the `/v7` in the import path.
- △The examples assume a working Go development environment already exists, and for the notification-listening extensions specifically, a MinIO server rather than generic S3 — not stated as a hard requirement, but implied by the API surface.
- △Streaming behavior, retry logic, and thread-safety of a shared `minio.Client` aren't discussed in the README — not clearly documented, so you'd need to check the godoc or source directly.
Alternatives to MinIO Go Client
Common Questions
MinIO Go Client SDK operates subject to the Apache License, Version 2.0, per the LICENSE and NOTICE files in its repository.
MinIO Go Client SDK works with any Amazon S3 compatible object storage, not just MinIO's own servers — its README describes the library as providing APIs to access any S3-compatible service, and Amazon S3 qualifies.
MinIO Go Client SDK covers bucket operations (create, list, remove, check existence), object operations (get, put, copy, remove, streaming), presigned URL generation, bucket policies, and bucket notifications, per the README's API reference.
MinIO Go Client SDK's repository links full runnable examples for every operation category — bucket, object, presigned, encryption, lifecycle, and replication — under its examples/s3 and examples/minio folders, plus a complete FileUploader.go quickstart in the README.
MinIO Go Client SDK does include MinIO-only functionality: the README labels ListenBucketNotification and ListenNotification as MinIO Extension calls, meaning they go beyond the standard S3 API and are specific to MinIO servers.
The problem it solves
Talking to S3-compatible storage from Go usually means either pulling in AWS's own SDK — built around AWS's broader service catalog, not just S3 — or hand-implementing the AWS Signature V4 signing scheme yourself. MinIO Go Client SDK's own topics list `aws-signature` and `client-sdk` alongside `s3`, and its README frames the whole project around one narrow job: give Go code straightforward APIs against any S3-compatible object storage endpoint, MinIO or otherwise, without either of those two costs.
Best use cases
- •Uploading and downloading files from a Go backend to MinIO or another S3-compatible store, using FPutObject/FGetObject instead of wiring up io.Reader/io.Writer plumbing by hand.
- •Generating time-limited, credential-free download or upload links for end users via PresignedGetObject and PresignedPutObject.
- •Managing bucket lifecycle, encryption, and replication settings from Go code, since the repository ships full runnable examples for each.
- •Streaming bucket-level events (object created, removed, and similar) from a MinIO server specifically, via the MinIO Extension calls ListenBucketNotification and ListenNotification.
- •Running server-side queries against object content with SelectObjectContent instead of downloading a whole object just to filter it client-side.
Who should try it — and who should skip
Try MinIO Go Client SDK if you're writing a Go service that needs to read or write objects in MinIO or any other S3-compatible store and want a client built specifically around the S3 API rather than a general-purpose cloud SDK — the bucket/object/presigned surface covers the operations most apps actually need. Skip it if your Go code already depends on AWS SDK for Go for other AWS services beyond S3, where switching just the storage calls to a second SDK adds a dependency without removing the first one; skip it too if you need the MinIO Extension calls (ListenBucketNotification, ListenNotification) to run unmodified against a non-MinIO S3 backend, since the README marks those as MinIO-specific.
Related repositories
Curious whether minio-go is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about minio-go.
