google /go-cloud

The Go Cloud Development Kit (Go CDK): A library and tools for open cloud development in Go.

★ 9,928⑂ 863👁 208⑃ 2,484● 1,277▤ 49
GoApache-2.0Created 2018-03-21gocloud.dev/
下载:v0.49.0v0.49.0 ↓0.49.02026-11-12
+0
日增长
9,928
stars
863
forks
208
watchers
2,484
prs
1,277
issues
49
releases

README

The Go Cloud Development Kit (Go CDK)

_Write once, run on any cloud ☁️_


![PkgGoDev][PkgGoDev]

!GitHub go.mod Go version



  


The Go Cloud Development Kit (Go CDK) allows Go application developers to
seamlessly deploy cloud applications on any combination of cloud providers. It
does this by providing stable, idiomatic interfaces for common uses like storage
and databases. Think database/sql for cloud products.

Imagine writing this to read from blob storage (like Google Cloud Storage or
S3):

go
ctx := context.Background()
bucket, err := blob.OpenBucket(ctx, "s3://my-bucket")
if err != nil {
    return err
}
defer bucket.Close()
blobReader, err := bucket.NewReader(ctx, "my-blob", nil)
if err != nil {
    return err
}


and being able to run that code on any cloud you want, avoiding all the ceremony
of cloud-specific authorization, tracing, SDKs and all the other code required
to make an application portable across cloud platforms.

The project works well with a code generator called
Wire. It creates
human-readable code that only imports the cloud SDKs for services you use. This
allows the Go CDK to grow to support any number of cloud services, without
increasing compile times or binary sizes, and avoiding any side effects from
init() functions.

You can learn more about the project from our [announcement blog post][], or our
talk at Next 2018:

![Video: Building Go Applications for the Open Cloud (Cloud Next '18)][video]

[announcement blog post]: https://blog.golang.org/go-cloud
[PkgGoDev]: https://pkg.go.dev/mod/gocloud.dev
[travis]: https://travis-ci.com/google/go-cloud
[video]: https://www.youtube.com/watch?v=_2ZwhvIkgek

 Installation

shell
 First "cd" into your project directory if you have one to ensure "go get" uses
 Go modules (or not) appropriately. See "go help modules" for more info.
go get gocloud.dev


The Go CDK builds at the latest stable release of Go. Previous Go versions may
compile but are not supported.

 Documentation

Documentation for the project lives primarily on https://gocloud.dev/, including
[tutorials][].

You can also browse Go package reference on [pkg.go.dev][PkgGoDev].

[tutorials]: https://gocloud.dev/tutorials/

 Project status

The APIs are still in alpha, but we think they are production-ready and are
actively looking for feedback from early adopters. If you have comments or
questions please open an issue.

At this time we prefer to focus on maintaining the existing APIs and drivers,
and are unlikely to accept new ones into the go-cloud repository. The modular
nature of the Go CDK makes it simple to host new APIs and drivers for existing
APIs externally, in separate repositories.

If you have a new API or driver that you believe are important and mature enough
to be included, feel free to open an issue to discuss this; our default will
likely be to suggest starting in a separate repository.

 Known External Drivers

   gocloud-ext — blob drivers for HTTP and WebDAV (httpblob) and for SFTP (sftpblob).
 

Latest release

v0.49.0 v0.49.0 2026-11-12
What's Changed

 blob/azblob: ensure localhost port is numeric by @vangent in https://github.com/google/go-cloud/pull/3835
 blob/gcsblob: close the downloader when BeforeRead fails by @iamabhilaksh in https://github.com/google/go-cloud/pull/3834
 blob: avoid recursive read locks in ReadAll and Download by @iamabhilaksh in https://github.com/google/go-cloud/pull/3832
 blob: hold b.mu when reading default WriterOptions by @iamabhilaksh in https://github.com/google/go-cloud/pull/3833
 blob/gcsblob: remove unnecessary test by @vangent in https://github.com/google/go-cloud/pull/3836
 blob: d

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON