_content: replace https://blog.golang.org/ links with /blog/
Global search and replace in HTML for href="https://blog.golang.org/ and in Markdown for ](https://blog.golang.org/ Change-Id: Ife69e89a42a631fa5c8babd07201ed0d7796eb0e Reviewed-on: https://go-review.googlesource.com/c/website/+/548062 Auto-Submit: Russ Cox <rsc@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
This commit is contained in:
Родитель
94530e9339
Коммит
f74533cb3d
|
@ -17,7 +17,7 @@ and ecosystem for building modern networked software.
|
|||
To mark the occasion,
|
||||
[Renee French](https://twitter.com/reneefrench),
|
||||
the creator of the
|
||||
[Go gopher](https://blog.golang.org/gopher),
|
||||
[Go gopher](/blog/gopher),
|
||||
painted this delightful scene:
|
||||
|
||||
<a href="10years/gopher10th-large.jpg">
|
||||
|
@ -86,7 +86,7 @@ we have evolved this idea and sketch into a productive language
|
|||
with fantastic tooling,
|
||||
a production-quality implementation,
|
||||
a
|
||||
[state-of-the-art garbage collector](https://blog.golang.org/ismmkeynote),
|
||||
[state-of-the-art garbage collector](/blog/ismmkeynote),
|
||||
and [ports to 12 operating systems and 10 architectures](/doc/install/source#introduction).
|
||||
|
||||
Any programming language needs the support of a thriving ecosystem.
|
||||
|
|
|
@ -9,16 +9,16 @@ summary: Happy Birthday, Go!
|
|||
|
||||
Today we celebrate the eleventh birthday of the Go open source release.
|
||||
The parties we had for
|
||||
[Go turning 10](https://blog.golang.org/10years)
|
||||
[Go turning 10](/blog/10years)
|
||||
seem like a distant memory.
|
||||
It’s been a tough year, but
|
||||
we’ve kept Go development moving forward
|
||||
and accumulated quite a few highlights.
|
||||
|
||||
In November, we launched [go.dev and pkg.go.dev](https://blog.golang.org/go.dev)
|
||||
In November, we launched [go.dev and pkg.go.dev](/blog/go.dev)
|
||||
shortly after Go’s 10th birthday.
|
||||
|
||||
In February, the [Go 1.14 release](https://blog.golang.org/go1.14)
|
||||
In February, the [Go 1.14 release](/blog/go1.14)
|
||||
delivered the first officially “production-ready” implementation of Go modules,
|
||||
along with many performance improvements,
|
||||
including
|
||||
|
@ -29,7 +29,7 @@ to reduce scheduling
|
|||
and garbage collection latency.
|
||||
|
||||
In early March, we launched a
|
||||
[new API for protocol buffers](https://blog.golang.org/protobuf-apiv2),
|
||||
[new API for protocol buffers](/blog/protobuf-apiv2),
|
||||
[google.golang.org/protobuf](https://pkg.go.dev/google.golang.org/protobuf),
|
||||
with much-improved support for protocol buffer reflection and custom messages.
|
||||
|
||||
|
@ -51,15 +51,15 @@ which enables advanced
|
|||
[Go-aware support](https://github.com/golang/tools/blob/master/gopls/doc/user.md)
|
||||
in many editors.
|
||||
In June, the
|
||||
[VSCode Go extension officially joined the Go project](https://blog.golang.org/vscode-go)
|
||||
[VSCode Go extension officially joined the Go project](/blog/vscode-go)
|
||||
and is now maintained by the same developers who work on gopls.
|
||||
|
||||
Also in June, thanks to your feedback, we open-sourced
|
||||
[the code behind pkg.go.dev](https://blog.golang.org/pkgsite)
|
||||
[the code behind pkg.go.dev](/blog/pkgsite)
|
||||
as part of the Go project as well.
|
||||
|
||||
Later in June, we
|
||||
[released the latest design draft for generics](https://blog.golang.org/generics-next-step),
|
||||
[released the latest design draft for generics](/blog/generics-next-step),
|
||||
along with a prototype tool and [generics playground](https://go2goplay.golang.org/).
|
||||
|
||||
In July, we published and discussed three new design drafts for future changes:
|
||||
|
@ -69,13 +69,13 @@ and
|
|||
[build-time file embedding](/design/draft-embed).
|
||||
(We’ll see all of those in 2021, as noted below.)
|
||||
|
||||
In August, the [Go 1.15 release](https://blog.golang.org/go1.15)
|
||||
In August, the [Go 1.15 release](/blog/go1.15)
|
||||
delivered mainly optimizations and bug fixes rather than new features.
|
||||
The most significant was the start of a rewrite of the linker,
|
||||
making it run 20% faster and use 30% less memory
|
||||
on average for large builds.
|
||||
|
||||
Last month, we ran our [annual Go user survey](https://blog.golang.org/survey2020).
|
||||
Last month, we ran our [annual Go user survey](/blog/survey2020).
|
||||
We will post results on the blog once we’ve analyzed them.
|
||||
|
||||
The Go community has adapted to “virtual-first” along with everyone else,
|
||||
|
@ -164,7 +164,7 @@ From the start, the [goal for Go modules](https://research.swtch.com/vgo-intro)
|
|||
has been “to add the concept of package versions to the working vocabulary
|
||||
of both Go developers and our tools,”
|
||||
to enable deep support for modules and versions throughout the Go ecosystem.
|
||||
The [Go module mirror, checksum database, and index](https://blog.golang.org/modules2019)
|
||||
The [Go module mirror, checksum database, and index](/blog/modules2019)
|
||||
were made possible by this ecosystem-wide understanding of what a package version is.
|
||||
Over the next year, we will see rich module support added to more tools and systems.
|
||||
For example, we plan to investigate new tooling to help module authors publish new versions
|
||||
|
@ -195,7 +195,7 @@ The Go package discovery site
|
|||
is another example of a version-aware system enabled by Go modules.
|
||||
We’ve been focused on getting the core functionality and user experience right,
|
||||
including a
|
||||
[redesign launching today](https://blog.golang.org/pkgsite-redesign).
|
||||
[redesign launching today](/blog/pkgsite-redesign).
|
||||
Over the next year,
|
||||
we will be unifying godoc.org into pkg.go.dev.
|
||||
We will also be expanding the version timeline for each package,
|
||||
|
@ -212,7 +212,7 @@ that Go modules are enabling.
|
|||
|
||||
The next feature on everyone’s minds is of course generics.
|
||||
As we mentioned above, we published the
|
||||
[latest design draft for generics](https://blog.golang.org/generics-next-step)
|
||||
[latest design draft for generics](/blog/generics-next-step)
|
||||
back in June.
|
||||
Since then, we’ve continued to refine rough edges and have turned our
|
||||
attention to the details of implementing a production-ready version.
|
||||
|
|
|
@ -73,7 +73,7 @@ The debugging story has gotten better, too.
|
|||
Recent improvements to the DWARF output of the gc compilers make the GNU debugger,
|
||||
GDB, useful for Go binaries, and we’re actively working on making that
|
||||
debugging information more complete.
|
||||
(See the [ recent blog post](https://blog.golang.org/2010/11/debugging-go-code-status-report.html) for details.)
|
||||
(See the [ recent blog post](/blog/2010/11/debugging-go-code-status-report.html) for details.)
|
||||
|
||||
It’s now easier than ever to link against existing libraries written in
|
||||
languages other than Go.
|
||||
|
@ -95,7 +95,7 @@ and hundreds more on [Google Code](http://code.google.com/hosting/search?q=label
|
|||
and [GitHub](https://github.com/search?q=language:Go).
|
||||
On our mailing list and IRC channel you can find coders from around the
|
||||
world who use Go for their programming projects.
|
||||
(See our [guest blog post](https://blog.golang.org/2010/10/real-go-projects-smarttwitter-and-webgo.html)
|
||||
(See our [guest blog post](/blog/2010/10/real-go-projects-smarttwitter-and-webgo.html)
|
||||
from last month for a real-world example.) Internally at Google there are
|
||||
several teams that choose Go for building production software,
|
||||
and we have received reports from other companies that are developing sizable systems in Go.
|
||||
|
@ -117,7 +117,7 @@ many of which were driven by feedback from the community.
|
|||
[spec](/doc/go_spec.html#Slices)
|
||||
- The new built-in function `recover` complements `panic` and `defer` as
|
||||
an error handling mechanism.
|
||||
[blog](https://blog.golang.org/2010/08/defer-panic-and-recover.html),
|
||||
[blog](/blog/2010/08/defer-panic-and-recover.html),
|
||||
[spec](/doc/go_spec.html#Handling_panics)
|
||||
- The new complex number types (`complex`,
|
||||
`complex64`, and `complex128`) simplify certain mathematical operations.
|
||||
|
|
|
@ -22,7 +22,7 @@ and were gradually joined by dozens - and then hundreds - of programmers
|
|||
from the open source community.
|
||||
The Go Authors went on to produce lots of libraries,
|
||||
new tools, and reams of [documentation](/doc/docs.html).
|
||||
They celebrated a successful year in the public eye with a [blog post](https://blog.golang.org/2010/11/go-one-year-ago-today.html)
|
||||
They celebrated a successful year in the public eye with a [blog post](/blog/2010/11/go-one-year-ago-today.html)
|
||||
last November that concluded "Go is certainly ready for production use,
|
||||
but there is still room for improvement.
|
||||
Our focus for the immediate future is making Go programs faster and more
|
||||
|
@ -32,7 +32,7 @@ Today is the second anniversary of Go's release,
|
|||
and Go is faster and more stable than ever.
|
||||
Careful tuning of Go's code generators, concurrency primitives,
|
||||
garbage collector, and core libraries have increased the performance of Go programs,
|
||||
and native support for [profiling](https://blog.golang.org/2011/06/profiling-go-programs.html)
|
||||
and native support for [profiling](/blog/2011/06/profiling-go-programs.html)
|
||||
and [debugging](http://blog.golang.org/2011/10/debugging-go-programs-with-gnu-debugger.html)
|
||||
makes it easier to detect and remove performance issues in user code.
|
||||
Go is also now easier to learn with [A Tour of Go](/tour/),
|
||||
|
@ -57,7 +57,7 @@ This year we issued several "[release](/doc/devel/release.html)"
|
|||
versions of Go that were more reliable and better supported than weekly snapshots.
|
||||
We also introduced [gofix](/cmd/gofix/) to take the
|
||||
pain out of migrating to newer releases.
|
||||
Furthermore, last month we announced a [plan for Go version 1](https://blog.golang.org/2011/10/preview-of-go-version-1.html) -
|
||||
Furthermore, last month we announced a [plan for Go version 1](/blog/2011/10/preview-of-go-version-1.html) -
|
||||
a release that will be supported for years to come.
|
||||
Work toward Go 1 is already underway and you can observe our progress by
|
||||
the latest weekly snapshot at [weekly.golang.org](http://weekly.golang.org/pkg/).
|
||||
|
|
|
@ -28,13 +28,13 @@ We added a package management system
|
|||
which eventually became the
|
||||
[go command](/cmd/go/).
|
||||
We also added
|
||||
[support for Go on App Engine](https://blog.golang.org/2011/07/go-for-app-engine-is-now-generally.html).
|
||||
[support for Go on App Engine](/blog/2011/07/go-for-app-engine-is-now-generally.html).
|
||||
Over the past year we've also given [many talks](/doc/#talks), created an [interactive introductory tour](/tour/)
|
||||
and recently we added support for [executable examples in package documentation](/pkg/strings/#pkg-examples).
|
||||
|
||||
Perhaps the most important development in the past year
|
||||
was the launch of the first stable version,
|
||||
[Go 1](https://blog.golang.org/2012/03/go-version-1-is-released.html).
|
||||
[Go 1](/blog/2012/03/go-version-1-is-released.html).
|
||||
People who write Go 1 programs can now be confident that their programs will
|
||||
continue to compile and run without change, in many environments,
|
||||
on a time scale of years.
|
||||
|
@ -59,7 +59,7 @@ and of course running the
|
|||
[Go home page](/)
|
||||
on [App Engine](https://developers.google.com/appengine/docs/go/overview).
|
||||
Last year's
|
||||
[Thanksgiving Doodle](https://blog.golang.org/2011/12/from-zero-to-go-launching-on-google.html)
|
||||
[Thanksgiving Doodle](/blog/2011/12/from-zero-to-go-launching-on-google.html)
|
||||
and the recent
|
||||
[Jam with Chrome](http://www.jamwithchrome.com/technology)
|
||||
site are also served by Go programs.
|
||||
|
@ -68,11 +68,11 @@ Other companies and projects are using Go too, including
|
|||
[BBC Worldwide](http://www.quora.com/Go-programming-language/Is-Google-Go-ready-for-production-use/answer/Kunal-Anand),
|
||||
[Canonical](http://dave.cheney.net/wp-content/uploads/2012/08/august-go-meetup.pdf),
|
||||
[CloudFlare](http://blog.cloudflare.com/go-at-cloudflare),
|
||||
[Heroku](https://blog.golang.org/2011/04/go-at-heroku.html),
|
||||
[Heroku](/blog/2011/04/go-at-heroku.html),
|
||||
[Novartis](https://plus.google.com/114945221884326152379/posts/d1SVaqkRyTL),
|
||||
[SoundCloud](http://backstage.soundcloud.com/2012/07/go-at-soundcloud/),
|
||||
[SmugMug](http://sorcery.smugmug.com/2012/04/06/deriving-json-types-in-go/),
|
||||
[StatHat](https://blog.golang.org/2011/12/building-stathat-with-go.html),
|
||||
[StatHat](/blog/2011/12/building-stathat-with-go.html),
|
||||
[Tinkercad](https://tinkercad.com/about/jobs),
|
||||
and
|
||||
[many others](/wiki/GoUsers).
|
||||
|
|
|
@ -138,7 +138,7 @@ it's easy to believe that prediction.
|
|||
So how can you get involved? Whether you're a seasoned Go programmer or just Go-curious,
|
||||
there are many ways to get started in the Go community:
|
||||
|
||||
- [Join your nearest Go User Group](https://blog.golang.org/getthee-to-go-meetup),
|
||||
- [Join your nearest Go User Group](/blog/getthee-to-go-meetup),
|
||||
where your local gophers meet to share their knowledge and experience.
|
||||
These groups are popping up all over the world.
|
||||
I have personally spoken at Go groups in Amsterdam,
|
||||
|
|
|
@ -48,9 +48,9 @@ metrics, the Go community is growing faster than we believed possible.
|
|||
|
||||
Where can those gophers be found? They are at the many Go events that are
|
||||
popping up around the world. This year we saw several dedicated Go conferences:
|
||||
the inaugural [GopherCon](https://blog.golang.org/gophercon) and
|
||||
the inaugural [GopherCon](/blog/gophercon) and
|
||||
[dotGo](http://www.dotgo.eu/) conferences in Denver and Paris, the
|
||||
[Go DevRoom at FOSDEM](https://blog.golang.org/fosdem14) and two more
|
||||
[Go DevRoom at FOSDEM](/blog/fosdem14) and two more
|
||||
instances of the biannual [GoCon](https://github.com/GoCon/GoCon) conference
|
||||
in Tokyo. At each event, gophers from around the globe eagerly presented their
|
||||
Go projects. For the Go team, it is very satisfying to meet so many programmers
|
||||
|
@ -64,7 +64,7 @@ There are also dozens of community-run
|
|||
[Go User Groups](/wiki/GoUserGroups) spread across cities
|
||||
worldwide. If you haven't visited your local group, consider going along. And
|
||||
if there isn't a group in your area, maybe you should
|
||||
[start one](https://blog.golang.org/getthee-to-go-meetup)?
|
||||
[start one](/blog/getthee-to-go-meetup)?
|
||||
|
||||
Today, Go has found a home in the cloud. Go arrived as the industry underwent a
|
||||
tectonic shift toward cloud computing, and we were thrilled to see it quickly
|
||||
|
|
|
@ -11,13 +11,13 @@ Six years ago today the Go language was released as an open source project.
|
|||
Since then, more than 780 contributors have made over 30,000 commits to the
|
||||
project's 22 repositories. The ecosystem continues to grow, with GitHub
|
||||
reporting more than 90,000 Go repositories. And, offline, we see new Go events
|
||||
and user groups pop up [around](https://blog.golang.org/gophercon2015)
|
||||
[the](https://blog.golang.org/gouk15)
|
||||
[world](https://blog.golang.org/gopherchina) with regularity.
|
||||
and user groups pop up [around](/blog/gophercon2015)
|
||||
[the](/blog/gouk15)
|
||||
[world](/blog/gopherchina) with regularity.
|
||||
|
||||
{{image "6years/6years-gopher.png"}}
|
||||
|
||||
In August we [released Go 1.5](https://blog.golang.org/go1.5), the most
|
||||
In August we [released Go 1.5](/blog/go1.5), the most
|
||||
significant release since Go 1. It features a completely
|
||||
[redesigned garbage collector](/doc/go1.5#gc) that makes
|
||||
the language more suitable for latency-sensitive applications; it marks the
|
||||
|
|
|
@ -18,7 +18,7 @@ The most significant user-facing changes to Go over the past year are the
|
|||
addition of built-in support for
|
||||
[HTTP/2](https://www.youtube.com/watch?v=FARQMJndUn0#t=0m0s) in
|
||||
[Go 1.6](/doc/go1.6) and the integration of the
|
||||
[context package](https://blog.golang.org/context) into the standard library in [Go 1.7](/doc/go1.7).
|
||||
[context package](/blog/context) into the standard library in [Go 1.7](/doc/go1.7).
|
||||
But we’ve been making many less visible improvements.
|
||||
Go 1.7 changed the x86-64 compiler to use a new SSA-based back end,
|
||||
improving the performance of most Go programs by 10–20%.
|
||||
|
@ -28,10 +28,10 @@ We’ve also added new ports, to Android on 32-bit x86, Linux on 64-bit MIPS,
|
|||
and Linux on IBM z Systems.
|
||||
And we’ve developed new garbage-collection techniques that reduce typical
|
||||
“stop the world” pauses to [under 100 microseconds](/design/17503-eliminate-rescan).
|
||||
(Contrast that with Go 1.5’s big news of [10 milliseconds or less](https://blog.golang.org/go15gc).)
|
||||
(Contrast that with Go 1.5’s big news of [10 milliseconds or less](/blog/go15gc).)
|
||||
|
||||
This year kicked off with a global Go hackathon,
|
||||
the [Gopher Gala](https://blog.golang.org/gophergala), in January.
|
||||
the [Gopher Gala](/blog/gophergala), in January.
|
||||
Then there were [Go conferences](/wiki/Conferences) in India and Dubai in February,
|
||||
China and Japan in April, San Francisco in May, Denver in July,
|
||||
London in August, Paris last month, and Brazil this past weekend.
|
||||
|
|
|
@ -11,7 +11,7 @@ summary: Happy 8th birthday, Go!
|
|||
|
||||
|
||||
Today we celebrate 8 years since Go was released as an open source project.
|
||||
During [Go’s 4th anniversary](https://blog.golang.org/4years), Andrew
|
||||
During [Go’s 4th anniversary](/blog/4years), Andrew
|
||||
finished the post with “Here's to four more years!”. Now that we have reached
|
||||
that milestone, I cannot help but reflect on how much the project and
|
||||
ecosystem has grown since then. In our post 4 years ago we included a chart
|
||||
|
@ -74,10 +74,10 @@ alone over 50 scholarships to conferences have been given through efforts of
|
|||
Go Bridge and Women Who Go.
|
||||
|
||||
This year we had two significant firsts for the Go project. We had our first
|
||||
[contributor summit](https://blog.golang.org/contributors-summit) where
|
||||
[contributor summit](/blog/contributors-summit) where
|
||||
people from across the Go community came together to
|
||||
discuss the needs and future of the Go project. Shortly after, we had the
|
||||
first [Go contributor workshop](https://blog.golang.org/contributor-workshop)
|
||||
first [Go contributor workshop](/blog/contributor-workshop)
|
||||
where hundreds of people came to make their first Go contribution.
|
||||
|
||||
{{image "8years/photo.jpg"}}
|
||||
|
@ -148,8 +148,8 @@ enthusiasm and support of the Go community.
|
|||
Since Go was first open sourced we have had 10 releases of the language,
|
||||
libraries and tooling with more than 1680 contributors making over 50,000
|
||||
commits to the project's 34 repositories; More than double the number of
|
||||
contributors and nearly double the number of commits from only [two years ago](https://blog.golang.org/6years).
|
||||
This year we announced that we have begun planning [Go 2](https://blog.golang.org/toward-go2), our first major
|
||||
contributors and nearly double the number of commits from only [two years ago](/blog/6years).
|
||||
This year we announced that we have begun planning [Go 2](/blog/toward-go2), our first major
|
||||
revision of the language and tooling.
|
||||
|
||||
The Go team would like to thank everyone who has contributed to the project,
|
||||
|
|
|
@ -55,7 +55,7 @@ and how we can better support gophers worldwide.
|
|||
- [The Legacy of Go, Part 2](https://www.youtube.com/watch?v=I_KcpgxcFyU), by Carmen Andoh at GothamGo
|
||||
- [Growing a Community of Gophers](https://www.youtube.com/watch?v=dl1mCGKwlYY), by Cassandra Salisbury at Gopherpalooza
|
||||
|
||||
On that theme, this year we also [revised our code of conduct](https://blog.golang.org/conduct-2018)
|
||||
On that theme, this year we also [revised our code of conduct](/blog/conduct-2018)
|
||||
to better support inclusivity in the Go community.
|
||||
|
||||
The Go community is truly global.
|
||||
|
@ -71,17 +71,17 @@ After five years of experience with Go 1, we’ve started looking at
|
|||
what we should change about Go to better support
|
||||
[programming at scale](/talks/2012/splash.article).
|
||||
|
||||
Last spring, we published a [draft design for Go modules](https://blog.golang.org/versioning-proposal),
|
||||
Last spring, we published a [draft design for Go modules](/blog/versioning-proposal),
|
||||
which provide an integrated mechanism for versioning and package distribution.
|
||||
The most recent Go release, Go 1.11, included
|
||||
[preliminary support for modules](/doc/go1.11#modules).
|
||||
|
||||
Last summer we published
|
||||
[early draft designs](https://blog.golang.org/go2draft)
|
||||
[early draft designs](/blog/go2draft)
|
||||
for how Go 2 might better support error values, error handling, and generic programming.
|
||||
|
||||
We are excited about refining these designs with the community’s help as we work
|
||||
[toward Go 2](https://blog.golang.org/toward-go2).
|
||||
[toward Go 2](/blog/toward-go2).
|
||||
|
||||
## Go Contributors
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ summary: Announcing improvements to Go on App Engine.
|
|||
|
||||
## Background
|
||||
|
||||
When we [launched Go for App Engine](https://blog.golang.org/go-and-google-app-engine)
|
||||
When we [launched Go for App Engine](/blog/go-and-google-app-engine)
|
||||
in May 2011 the SDK was just a modified version of the Python SDK.
|
||||
At the time, there was no canonical way to build or organize Go programs, so it
|
||||
made sense to take the Python approach. Since then Go 1.0 was released,
|
||||
|
@ -19,7 +19,7 @@ including the [go tool](/cmd/go/) and a
|
|||
[convention](/doc/code.html) for organizing Go programs.
|
||||
|
||||
In January 2013 we announced
|
||||
[better integration](https://blog.golang.org/the-app-engine-sdk-and-workspaces-gopath)
|
||||
[better integration](/blog/the-app-engine-sdk-and-workspaces-gopath)
|
||||
between the Go App Engine SDK and the go tool, promoting the use of
|
||||
conventional import paths in App Engine apps and making it possible to use "go
|
||||
get" to fetch app dependencies.
|
||||
|
|
|
@ -11,7 +11,7 @@ summary: Google Cloud is announcing a new Go 1.11 runtime for App Engine, with f
|
|||
|
||||
|
||||
[App Engine](https://cloud.google.com/appengine/) launched
|
||||
[experimental support for Go](https://blog.golang.org/go-and-google-app-engine)
|
||||
[experimental support for Go](/blog/go-and-google-app-engine)
|
||||
in 2011. In the subsequent years, the Go community has grown significantly and
|
||||
has settled on idiomatic
|
||||
patterns for cloud-based applications. Today, Google Cloud is
|
||||
|
|
|
@ -10,7 +10,7 @@ summary: How to build scalable web applications using Go with Google App Engine.
|
|||
---
|
||||
|
||||
|
||||
Back in May, we [announced](https://blog.golang.org/2011/05/go-and-google-app-engine.html)
|
||||
Back in May, we [announced](/blog/2011/05/go-and-google-app-engine.html)
|
||||
the Go runtime for App Engine.
|
||||
Since then, we've opened it up for everyone to use,
|
||||
added many new APIs, and improved performance.
|
||||
|
|
|
@ -102,7 +102,7 @@ Here is a string constant:
|
|||
"Hello, 世界"
|
||||
|
||||
(For much more detail about the representation and interpretation of strings,
|
||||
see [this blog post](https://blog.golang.org/strings).)
|
||||
see [this blog post](/blog/strings).)
|
||||
|
||||
What type does this string constant have?
|
||||
The obvious answer is `string`, but that is _wrong_.
|
||||
|
@ -218,7 +218,7 @@ If the constant has a type, that goes into the interface, as this example shows:
|
|||
{{play "constants/default3.go" `/START/` `/STOP/`}}
|
||||
|
||||
(For more information about how interface values work,
|
||||
see the first sections of [this blog post](https://blog.golang.org/laws-of-reflection).)
|
||||
see the first sections of [this blog post](/blog/laws-of-reflection).)
|
||||
|
||||
In summary, a typed constant obeys all the rules of typed values in Go.
|
||||
On the other hand, an untyped constant does not carry a Go type in the same
|
||||
|
@ -462,7 +462,7 @@ Here, then, is our constant:
|
|||
{{play "constants/exercise6.go" `/START/` `/STOP/`}}
|
||||
|
||||
Whatever the number of bits it takes to represent a `uint` in the current execution environment
|
||||
(on the [playground](https://blog.golang.org/playground), it's 32),
|
||||
(on the [playground](/blog/playground), it's 32),
|
||||
this constant correctly represents the largest value a variable of type `uint` can hold.
|
||||
|
||||
If you understand the analysis that got us to this result,
|
||||
|
|
|
@ -80,7 +80,7 @@ And, finally, it can be quite dangerous to design a production-grade server whos
|
|||
|
||||
When Go 1.7 — which [introduced context.Context](/doc/go1.7) — was released, a large number of APIs had to add context support in backwards compatible ways. For example, [`net/http`'s `Client` methods](/pkg/net/http/), like `Get` and `Do`, were excellent candidates for context. Each external request sent with these methods would benefit from having the deadline, cancellation, and metadata support that came with `context.Context`.
|
||||
|
||||
There are two approaches for adding support for `context.Context` in backwards compatible ways: including a context in a struct, as we'll see in a moment, and duplicating functions, with duplicates accepting `context.Context` and having `Context` as their function name suffix. The duplicate approach should be preferred over the context-in-struct, and is further discussed in [Keeping your modules compatible](https://blog.golang.org/module-compatibility). However, in some cases it's impractical: for example, if your API exposes a large number of functions, then duplicating them all might be infeasible.
|
||||
There are two approaches for adding support for `context.Context` in backwards compatible ways: including a context in a struct, as we'll see in a moment, and duplicating functions, with duplicates accepting `context.Context` and having `Context` as their function name suffix. The duplicate approach should be preferred over the context-in-struct, and is further discussed in [Keeping your modules compatible](/blog/module-compatibility). However, in some cases it's impractical: for example, if your API exposes a large number of functions, then duplicating them all might be infeasible.
|
||||
|
||||
The `net/http` package chose the context-in-struct approach, which provides a useful case study. Let's look at `net/http`'s `Do`. Prior to the introduction of `context.Context`, `Do` was defined as follows:
|
||||
|
||||
|
|
|
@ -62,7 +62,7 @@ the form of bug reports,
|
|||
of contributions.
|
||||
|
||||
The most common type of contribution was an example function to be used in the
|
||||
documentation. The [Go User survey](https://blog.golang.org/survey2016-results)
|
||||
documentation. The [Go User survey](/blog/survey2016-results)
|
||||
identified that our documentation was significantly lacking examples. In the
|
||||
presentation, we asked users to find a package they loved and to add an example. In
|
||||
the Go project, examples are written as code in Go files
|
||||
|
|
|
@ -71,7 +71,7 @@ discussion will likely continue on the mailing lists.
|
|||
### The standard library
|
||||
|
||||
The discussions we had around the future of the Go language are mostly covered
|
||||
in Russ Cox's blog post: [Toward Go 2](https://blog.golang.org//toward-go2), so
|
||||
in Russ Cox's blog post: [Toward Go 2](/blog//toward-go2), so
|
||||
let's move on to the standard library session.
|
||||
|
||||
As a contributor to the standard library and subrepos, this session was
|
||||
|
@ -155,7 +155,7 @@ During the breaks, Go team members dispersed themselves among the contributors
|
|||
for discussions both about Go and a little general socialization, which really
|
||||
helped to put faces to the names that review our code every day.
|
||||
|
||||
As Russ discussed in [Toward Go 2](https://blog.golang.org//toward-go2),
|
||||
As Russ discussed in [Toward Go 2](/blog//toward-go2),
|
||||
communicating effectively requires knowing your audience.
|
||||
Having a broad sample of Go contributors in a room together helped us all to
|
||||
understand the Go audience better and start many productive discussions about
|
||||
|
|
|
@ -56,7 +56,7 @@ correct and easy-to-read code.
|
|||
One example is the gofix tool, which automates the
|
||||
rewriting of code to use new language features or updated libraries.
|
||||
Gofix let us make fundamental changes to the language and libraries in the
|
||||
[run-up to Go 1.0](https://blog.golang.org/the-path-to-go-1),
|
||||
[run-up to Go 1.0](/blog/the-path-to-go-1),
|
||||
with the confidence that users could just run the tool to update their source to the newest version.
|
||||
|
||||
Inside Google, we have used gofix to make sweeping changes in a huge code repository that would be almost
|
||||
|
|
|
@ -11,7 +11,7 @@ summary: Announcing a new article about debugging Go programs with GDB.
|
|||
---
|
||||
|
||||
|
||||
Last year we [reported](https://blog.golang.org/2010/11/debugging-go-code-status-report.html)
|
||||
Last year we [reported](/blog/2010/11/debugging-go-code-status-report.html)
|
||||
that Go's [gc](/cmd/gc/)/[ld](/cmd/6l/)
|
||||
toolchain produces DWARFv3 debugging information that can be read by the GNU Debugger (GDB).
|
||||
Since then, work has continued steadily on improving support for debugging Go code with GDB.
|
||||
|
|
|
@ -322,7 +322,7 @@ Making `error` a simple interface
|
|||
and allowing many different implementations
|
||||
means we have the entire Go language
|
||||
available to define and inspect errors.
|
||||
We like to say that [errors are values](https://blog.golang.org/errors-are-values),
|
||||
We like to say that [errors are values](/blog/errors-are-values),
|
||||
the same as any other Go value.
|
||||
|
||||
Here’s an example.
|
||||
|
@ -856,7 +856,7 @@ We’ll find out.
|
|||
At Gophercon 2019, Ian Lance Taylor talked about
|
||||
why we might want to add generics to Go
|
||||
and briefly previewed the latest design draft.
|
||||
For details, see his blog post “[Why Generics?](https://blog.golang.org/why-generics)”
|
||||
For details, see his blog post “[Why Generics?](/blog/why-generics)”
|
||||
|
||||
## Dependencies
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ There is simply no mechanism to run Yacc from the go tool alone.
|
|||
|
||||
Until now, that is.
|
||||
|
||||
The [latest Go release](https://blog.golang.org/go1.4), 1.4,
|
||||
The [latest Go release](/blog/go1.4), 1.4,
|
||||
includes a new command that makes it easier to run such tools.
|
||||
It's called `go` `generate`, and it works by scanning for special comments in Go source code
|
||||
that identify general commands to run.
|
||||
|
|
|
@ -14,7 +14,7 @@ summary: An updated generics design draft, and a translation tool for experiment
|
|||
## Introduction
|
||||
|
||||
It’s been almost a year since we [last wrote about the possibility of
|
||||
adding generics to Go](https://blog.golang.org/why-generics).
|
||||
adding generics to Go](/blog/why-generics).
|
||||
It’s time for an update.
|
||||
|
||||
## Updated design
|
||||
|
|
|
@ -33,7 +33,7 @@ instance of the data structure.
|
|||
Since Go was first released in 2009, support for generics has been one
|
||||
of the most commonly requested language features.
|
||||
You can read more about why generics are useful in
|
||||
[an earlier blog post](https://blog.golang.org/why-generics).
|
||||
[an earlier blog post](/blog/why-generics).
|
||||
|
||||
Although generics have clear use cases, fitting them cleanly into a
|
||||
language like Go is a difficult task.
|
||||
|
@ -48,7 +48,7 @@ parameters](/design/go2draft-type-parameters).
|
|||
This design draft has had a lot of input from the Go programming
|
||||
community, and many people have experimented with it using the
|
||||
[generics playground](https://go2goplay.golang.org) described in [an
|
||||
earlier blog post](https://blog.golang.org/generics-next-step).
|
||||
earlier blog post](/blog/generics-next-step).
|
||||
Ian Lance Taylor gave [a talk at GopherCon
|
||||
2019](https://www.youtube.com/watch?v=WzgLqE-3IhY)
|
||||
about why to add generics and the strategy we are now following.
|
||||
|
|
|
@ -161,7 +161,7 @@ It's a nice technique in Go programming to couple a slice (`b.slice`) to an arra
|
|||
In this case, it means `blockReader` type's `Read` method never does any allocations.
|
||||
It also means we don't need to keep a count around (it's implicit in the slice length),
|
||||
and the built-in `copy` function guarantees we never copy more than we should.
|
||||
(For more about slices, see [this post from the Go Blog](https://blog.golang.org/2011/01/go-slices-usage-and-internals.html).)
|
||||
(For more about slices, see [this post from the Go Blog](/blog/2011/01/go-slices-usage-and-internals.html).)
|
||||
|
||||
Given the `blockReader` type, we can unblock the image data stream just
|
||||
by wrapping the input reader,
|
||||
|
|
|
@ -8,7 +8,7 @@ summary: Recent changes to the Go Cloud Development Kit (Go CDK).
|
|||
|
||||
## Introduction
|
||||
|
||||
Last July, we [introduced](https://blog.golang.org/go-cloud) the [Go Cloud Development Kit](https://gocloud.dev)
|
||||
Last July, we [introduced](/blog/go-cloud) the [Go Cloud Development Kit](https://gocloud.dev)
|
||||
(previously referred to as simply "Go Cloud"),
|
||||
an open source project building libraries and tools to improve the experience
|
||||
of developing for the cloud with Go.
|
||||
|
|
|
@ -11,7 +11,7 @@ summary: How to use the new Go 1.13 error interfaces and functions.
|
|||
|
||||
## Introduction
|
||||
|
||||
Go’s treatment of [errors as values](https://blog.golang.org/errors-are-values)
|
||||
Go’s treatment of [errors as values](/blog/errors-are-values)
|
||||
has served us well over the last decade. Although the standard library’s support
|
||||
for errors has been minimal—just the `errors.New` and `fmt.Errorf` functions,
|
||||
which produce errors that contain only a message—the built-in `error` interface
|
||||
|
@ -345,6 +345,6 @@ handled in Go programs. We expect that wrapping to provide additional context
|
|||
will become commonplace, helping programs to make better decisions and helping
|
||||
programmers to find bugs more quickly.
|
||||
|
||||
As Russ Cox said in his [GopherCon 2019 keynote](https://blog.golang.org/experiment),
|
||||
As Russ Cox said in his [GopherCon 2019 keynote](/blog/experiment),
|
||||
on the path to Go 2 we experiment, simplify and ship. Now that we’ve
|
||||
shipped these changes, we look forward to the experiments that will follow.
|
||||
|
|
|
@ -16,7 +16,7 @@ summary: For Go 1.15, we propose three minor language cleanup changes.
|
|||
|
||||
We are close to the Go 1.14 release, planned for February assuming all goes
|
||||
well, with an RC1 candidate almost ready. Per the process outlined in the
|
||||
[Go 2, here we come!](https://blog.golang.org/go2-here-we-come) blog post,
|
||||
[Go 2, here we come!](/blog/go2-here-we-come) blog post,
|
||||
it is again the time in our development and release cycle to consider if and
|
||||
what language or library changes we might want to include for our next release,
|
||||
Go 1.15, scheduled for August of this year.
|
||||
|
@ -91,7 +91,7 @@ always a chance that we missed something important. For that reason we plan
|
|||
to have the proposals implemented at the beginning of the Go 1.15 release cycle
|
||||
(at or shortly after the Go 1.14 release) so that there is plenty of time to
|
||||
gather experience and provide feedback. Per the
|
||||
[proposal evaluation process](https://blog.golang.org/go2-here-we-come),
|
||||
[proposal evaluation process](/blog/go2-here-we-come),
|
||||
the final decision will be made at the end of the development cycle, at the
|
||||
beginning of May, 2020.
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ Go 1.16 also adds
|
|||
[macOS ARM64 support](/doc/go1.16#darwin)
|
||||
(also known as Apple silicon).
|
||||
Since Apple’s announcement of their new arm64 architecture, we have been working closely with them to ensure Go is fully supported; see our blog post
|
||||
“[Go on ARM and Beyond](https://blog.golang.org/ports)”
|
||||
“[Go on ARM and Beyond](/blog/ports)”
|
||||
for more.
|
||||
|
||||
Note that Go 1.16
|
||||
|
|
|
@ -26,7 +26,7 @@ See [the documentation](/lib/godoc/analysis/help.html) for the details.
|
|||
The gc toolchain now supports the Native Client (NaCl) execution sandbox on the
|
||||
32- and 64-bit Intel architectures.
|
||||
This permits the safe execution of untrusted code, useful in environments such as the
|
||||
[Playground](https://blog.golang.org/playground).
|
||||
[Playground](/blog/playground).
|
||||
To set up NaCl on your system see the [NativeClient wiki page](/wiki/NativeClient).
|
||||
|
||||
Also included in this release is experimental support for the DragonFly BSD,
|
||||
|
|
|
@ -8,7 +8,7 @@ summary: Go 1.4 adds support for Android, go generate, optimizations, and more.
|
|||
|
||||
|
||||
Today we announce Go 1.4, the fifth major stable release of Go, arriving six
|
||||
months after our previous major release [Go 1.3](https://blog.golang.org/go1.3).
|
||||
months after our previous major release [Go 1.3](/blog/go1.3).
|
||||
It contains a small language change, support for more operating systems
|
||||
and processor architectures, and improvements to the tool chain and libraries.
|
||||
As always, Go 1.4 keeps the promise of compatibility, and almost everything
|
||||
|
|
|
@ -10,7 +10,7 @@ summary: Go 1.6 adds HTTP/2, template blocks, and more.
|
|||
Today we release [Go version 1.6](/doc/go1.6),
|
||||
the seventh major stable release of Go.
|
||||
You can grab it right now from the [download page](/dl/).
|
||||
Although [the release of Go 1.5](https://blog.golang.org/go1.5) six months ago
|
||||
Although [the release of Go 1.5](/blog/go1.5) six months ago
|
||||
contained dramatic implementation changes,
|
||||
this release is more incremental.
|
||||
|
||||
|
@ -41,7 +41,7 @@ The runtime has added lightweight, best-effort detection of concurrent misuse of
|
|||
As always, if one goroutine is writing to a map, no other goroutine should be reading or writing the map concurrently.
|
||||
If the runtime detects this condition, it prints a diagnosis and crashes the program.
|
||||
The best way to find out more about the problem is to run it under the
|
||||
[race detector](https://blog.golang.org/race-detector),
|
||||
[race detector](/blog/race-detector),
|
||||
which will more reliably identify the race and give more detail.
|
||||
|
||||
The runtime has also changed how it prints program-ending panics.
|
||||
|
|
|
@ -47,7 +47,7 @@ Support for contexts has been added to the
|
|||
[net/http](/pkg/net/http/), and
|
||||
[os/exec](/pkg/os/exec/) packages.
|
||||
For more information about contexts, see the [package documentation](/pkg/context)
|
||||
and the Go blog post [_Go Concurrency Patterns: Context_](https://blog.golang.org/context).
|
||||
and the Go blog post [_Go Concurrency Patterns: Context_](/blog/context).
|
||||
|
||||
Go 1.5 introduced experimental support for a ["vendor" directory](/cmd/go/#hdr-Vendor_Directories),
|
||||
enabled by the `GO15VENDOREXPERIMENT` environment variable.
|
||||
|
|
|
@ -11,7 +11,7 @@ Today the Go team is happy to announce the release of Go 1.8.
|
|||
You can get it from the [download page](/dl/).
|
||||
There are significant performance improvements and changes across the standard library.
|
||||
|
||||
The compiler back end introduced in [Go 1.7](https://blog.golang.org/go1.7) for 64-bit x86 is now used
|
||||
The compiler back end introduced in [Go 1.7](/blog/go1.7) for 64-bit x86 is now used
|
||||
on all architectures, and those architectures should see significant [performance improvements](/doc/go1.8#compiler).
|
||||
For instance, the CPU time required by our benchmark programs was reduced by 20-30% on 32-bit ARM systems.
|
||||
There are also some modest performance improvements in this release for 64-bit x86 systems.
|
||||
|
|
|
@ -14,7 +14,7 @@ summary: How Go 2 proposals will be evaluated, selected, and shipped.
|
|||
|
||||
At GopherCon 2017, Russ Cox officially started the thought process on the
|
||||
next big version of Go with his talk [The Future of Go](https://www.youtube.com/watch?v=0Zbh_vmAKvk)
|
||||
([blog post](https://blog.golang.org/toward-go2)). We have
|
||||
([blog post](/blog/toward-go2)). We have
|
||||
called this future language informally Go 2, even though we understand now
|
||||
that it will arrive in incremental steps rather than with a big bang and a
|
||||
single major release. Still, Go 2 is a useful moniker, if only to have a way
|
||||
|
@ -56,11 +56,11 @@ seemed clearly out of the scope of Go, or were otherwise unactionable.
|
|||
|
||||
Ideas from the remaining proposals will likely influence Go 2’s libraries
|
||||
and languages. Two major themes have emerged early on: support for better
|
||||
error handling, and generics. [Draft designs](https://blog.golang.org/go2draft)
|
||||
error handling, and generics. [Draft designs](/blog/go2draft)
|
||||
for these two areas have been
|
||||
published at this year’s GopherCon, and more exploration is needed.
|
||||
|
||||
But what about the rest? We are [constrained](https://blog.golang.org/toward-go2)
|
||||
But what about the rest? We are [constrained](/blog/toward-go2)
|
||||
by the fact that we now have
|
||||
millions of Go programmers and a large body of Go code, and we need to
|
||||
bring it all along, lest we risk a split ecosystem. That means we cannot
|
||||
|
|
|
@ -24,14 +24,14 @@ selected from the much larger list of
|
|||
[Go 2 proposals](https://github.com/golang/go/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen+label%3AGo2+label%3AProposal),
|
||||
per the new proposal evaluation process outlined
|
||||
in the
|
||||
“[Go 2, here we come!](https://blog.golang.org/go2-here-we-come)” blog post.
|
||||
“[Go 2, here we come!](/blog/go2-here-we-come)” blog post.
|
||||
We wanted our initial selection of proposals
|
||||
to be relatively minor and mostly uncontroversial,
|
||||
to have a reasonably high chance of having them
|
||||
make it through the process.
|
||||
The proposed changes had to be backward-compatible
|
||||
to be minimally disruptive since
|
||||
[modules](https://blog.golang.org/using-go-modules),
|
||||
[modules](/blog/using-go-modules),
|
||||
which eventually will allow module-specific language version selection,
|
||||
are not the default build mode quite yet.
|
||||
In short, this initial round of changes was more about
|
||||
|
@ -39,7 +39,7 @@ getting the ball rolling again and gaining experience
|
|||
with the new process, rather than tackling big issues.
|
||||
|
||||
Our
|
||||
[original list of proposals](https://blog.golang.org/go2-here-we-come) –
|
||||
[original list of proposals](/blog/go2-here-we-come) –
|
||||
[general Unicode identifiers](/issue/20706),
|
||||
[binary integer literals](/issue/19308),
|
||||
[separators for number literals](/issue/28493),
|
||||
|
@ -62,7 +62,7 @@ and determine what we want to tackle next.
|
|||
## Proposals for Go 1.14
|
||||
|
||||
The goals we have for Go today are the same as in 2007: to
|
||||
[make software development scale](https://blog.golang.org/toward-go2).
|
||||
[make software development scale](/blog/toward-go2).
|
||||
The three biggest hurdles on this path to improved scalability for Go are
|
||||
package and version management,
|
||||
better error handling support,
|
||||
|
@ -152,7 +152,7 @@ start of the
|
|||
(beginning of August, 2019)
|
||||
so that they can be evaluated in practice.
|
||||
Per the
|
||||
[proposal evaluation process](https://blog.golang.org/go2-here-we-come),
|
||||
[proposal evaluation process](/blog/go2-here-we-come),
|
||||
the final decision will be
|
||||
made at the end of the development cycle (beginning of November, 2019).
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ summary: Announcing the draft designs for the major Go 2 changes.
|
|||
Yesterday, at our annual Go contributor summit,
|
||||
attendees got a sneak peek at preliminary _drafts_ of
|
||||
possible designs for changes to error handling and generics.
|
||||
[The development of Go 2](https://blog.golang.org/toward-go2) was announced last year and we are excited to share updates with you today.
|
||||
[The development of Go 2](/blog/toward-go2) was announced last year and we are excited to share updates with you today.
|
||||
|
||||
For a quick overview, watch this short message we just played at Gophercon 2018:
|
||||
|
||||
|
|
|
@ -9,13 +9,13 @@ summary: The plan for moving from godoc.org to pkg.go.dev.
|
|||
|
||||
With the introduction of Go modules and the growth of the Go ecosystem,
|
||||
[pkg.go.dev](https://pkg.go.dev) was
|
||||
[launched in 2019](https://blog.golang.org/go.dev) to provide a central place
|
||||
[launched in 2019](/blog/go.dev) to provide a central place
|
||||
where developers can discover and evaluate Go packages and modules. Like
|
||||
godoc.org, pkg.go.dev serves Go documentation, but it also supports modules,
|
||||
better search functionality, and signals to help Go users to find the right
|
||||
packages.
|
||||
|
||||
As [we shared in January 2020](https://blog.golang.org/pkg.go.dev-2020), our
|
||||
As [we shared in January 2020](/blog/pkg.go.dev-2020), our
|
||||
goal is to eventually redirect traffic from godoc.org to the corresponding page
|
||||
on pkg.go.dev. We’ve also made it possible for users to opt in to redirecting
|
||||
their own requests from godoc.org to pkg.go.dev.
|
||||
|
@ -26,8 +26,8 @@ resolved through the
|
|||
and [pkgsite/design-2020](https://github.com/golang/go/milestone/159?closed=1)
|
||||
milestones on the Go issue tracker. Your feedback resulted in support for
|
||||
popular feature requests on pkg.go.dev,
|
||||
[open sourcing pkgsite](https://blog.golang.org/pkgsite), and most recently, a
|
||||
[redesign of pkg.go.dev](https://blog.golang.org/pkgsite-redesign).
|
||||
[open sourcing pkgsite](/blog/pkgsite), and most recently, a
|
||||
[redesign of pkg.go.dev](/blog/pkgsite-redesign).
|
||||
|
||||
## Next Steps
|
||||
|
||||
|
|
|
@ -104,4 +104,4 @@ It would have been daunting to attempt by hand,
|
|||
but with the code in a standard format it was relatively easy to prepare,
|
||||
execute, and review this change which touched almost all Go code in existence.
|
||||
|
||||
For more about gofix, see [this article](https://blog.golang.org/introducing-gofix).
|
||||
For more about gofix, see [this article](/blog/introducing-gofix).
|
||||
|
|
|
@ -30,7 +30,7 @@ conference from afar:
|
|||
[Day 1](http://gophercon.com/schedule/8july/):
|
||||
|
||||
- Go, Open Source, Community — Russ Cox ([video](https://www.youtube.com/watch?v=XvZOdpd_9tc))
|
||||
([text](https://blog.golang.org/open-source))
|
||||
([text](/blog/open-source))
|
||||
- Go kit: A Standard Library for Distributed Programming — Peter Bourgon
|
||||
([video](https://www.youtube.com/watch?v=1AjaZi4QuGo)) ([slides](https://github.com/gophercon/2015-talks/blob/master/Go%20kit/go-kit.pdf))
|
||||
- Delve Into Go — Derek Parker ([video](https://www.youtube.com/watch?v=InG72scKPd4))
|
||||
|
|
|
@ -35,7 +35,7 @@ collections of command-line tools.
|
|||
|
||||
In addition to working on `gopls`, we sought other ways of creating a stable
|
||||
ecosystem of editor tooling. Last year, the Go team took responsibility for the
|
||||
[Go extension for VS Code](https://blog.golang.org/vscode-go). As part of this
|
||||
[Go extension for VS Code](/blog/vscode-go). As part of this
|
||||
work, we smoothed the extension’s integration with the language server—automating
|
||||
`gopls` updates, rearranging and clarifying `gopls` settings, improving the
|
||||
troubleshooting workflow, and soliciting feedback through a survey. We’ve also
|
||||
|
|
|
@ -38,7 +38,7 @@ concurrent processes that communicate via passing messages.
|
|||
In Doozer, these processes are implemented as goroutines,
|
||||
and their communications as channel operations.
|
||||
In the same way that garbage collectors improve upon malloc and free,
|
||||
we found that [goroutines and channels](https://blog.golang.org/2010/07/share-memory-by-communicating.html)
|
||||
we found that [goroutines and channels](/blog/2010/07/share-memory-by-communicating.html)
|
||||
improve upon the lock-based approach to concurrency.
|
||||
These tools let us avoid complex bookkeeping and stay focused on the problem at hand.
|
||||
We are still amazed at how few lines of code it took to achieve something
|
||||
|
|
|
@ -16,7 +16,7 @@ Code that [implements an HTTP server handler](http://codereview.appspot.com/4239
|
|||
[calls `os.Open`](http://codereview.appspot.com/4357052),
|
||||
or [uses the reflect package](http://codereview.appspot.com/4281055) will
|
||||
not build unless it is updated to use the new APIs.
|
||||
Now that our releases are [more stable and less frequent](https://blog.golang.org/2011/03/go-becomes-more-stable.html),
|
||||
Now that our releases are [more stable and less frequent](/blog/2011/03/go-becomes-more-stable.html),
|
||||
this will be a common situation.
|
||||
Each of these API changes happened in a different weekly snapshot and might
|
||||
have been manageable on its own;
|
||||
|
|
|
@ -22,7 +22,7 @@ you can now watch videos of our two Go presentations on YouTube.
|
|||
## Writing Web Apps in Go
|
||||
|
||||
In “[Writing Web Apps in Go](http://www.youtube.com/watch?v=-i0hat7pdpk)”
|
||||
we announce the [Go runtime for Google App Engine](https://blog.golang.org/2011/05/go-and-google-app-engine.html)
|
||||
we announce the [Go runtime for Google App Engine](/blog/2011/05/go-and-google-app-engine.html)
|
||||
and walk through the development and deployment of [Moustachio](http://moustach-io.appspot.com/),
|
||||
the first Go App Engine app.
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ A project might be in one of three states when beginning the transition to Go mo
|
|||
- An established Go project with a non-modules dependency manager.
|
||||
- An established Go project without any dependency manager.
|
||||
|
||||
The first case is covered in [Using Go Modules](https://blog.golang.org/using-go-modules);
|
||||
The first case is covered in [Using Go Modules](/blog/using-go-modules);
|
||||
we'll address the latter two in this post.
|
||||
|
||||
## With a dependency manager
|
||||
|
|
|
@ -29,7 +29,7 @@ See the [recording](https://youtu.be/KqTySYYhPUE) if you are interested in the f
|
|||
|
||||
## Module Mirror
|
||||
|
||||
[Modules](https://blog.golang.org/versioning-proposal) are sets of Go packages
|
||||
[Modules](/blog/versioning-proposal) are sets of Go packages
|
||||
that are versioned together, and the contents of each version are immutable.
|
||||
That immutability provides new opportunities for caching and authentication.
|
||||
When `go get` runs in module mode, it must fetch the module containing the
|
||||
|
@ -55,7 +55,7 @@ A module mirror is a special kind of module proxy that caches metadata and
|
|||
source code in its own storage system, allowing the mirror to continue to serve
|
||||
source code that is no longer available from the original locations. This can
|
||||
speed up downloads and protect you from disappearing dependencies. See
|
||||
[Go Modules in 2019](https://blog.golang.org/modules2019) for more information.
|
||||
[Go Modules in 2019](/blog/modules2019) for more information.
|
||||
|
||||
The Go team maintains a module mirror, served at
|
||||
[proxy.golang.org](https://proxy.golang.org), which the `go` command will use by
|
||||
|
|
|
@ -13,13 +13,13 @@ summary: How and why to normalize UTF-8 text in Go.
|
|||
|
||||
## Introduction
|
||||
|
||||
An earlier [post](https://blog.golang.org/strings) talked about strings, bytes
|
||||
An earlier [post](/blog/strings) talked about strings, bytes
|
||||
and characters in Go. I've been working on various packages for multilingual
|
||||
text processing for the go.text repository. Several of these packages deserve a
|
||||
separate blog post, but today I want to focus on
|
||||
[go.text/unicode/norm](https://pkg.go.dev/golang.org/x/text/unicode/norm),
|
||||
which handles normalization, a topic touched in the
|
||||
[strings article](https://blog.golang.org/strings) and the subject of this
|
||||
[strings article](/blog/strings) and the subject of this
|
||||
post. Normalization works at a higher level of abstraction than raw bytes.
|
||||
|
||||
To learn pretty much everything you ever wanted to know about normalization
|
||||
|
|
|
@ -252,5 +252,5 @@ grow them gracefully.
|
|||
|
||||
- [Effective Go](/doc/effective_go.html)
|
||||
- [How to Write Go Code](/doc/code.html)
|
||||
- [Organizing Go Code (2012 blog post)](https://blog.golang.org/organizing-go-code)
|
||||
- [Organizing Go Code (2012 blog post)](/blog/organizing-go-code)
|
||||
- [Organizing Go Code (2014 Google I/O talk)](/talks/2014/organizeio.slide)
|
||||
|
|
|
@ -318,7 +318,7 @@ Further reading:
|
|||
- [Go Concurrency Patterns](/talks/2012/concurrency.slide#1)
|
||||
([video](https://www.youtube.com/watch?v=f6kdp27TYZs)) presents the basics
|
||||
of Go's concurrency primitives and several ways to apply them.
|
||||
- [Advanced Go Concurrency Patterns](https://blog.golang.org/advanced-go-concurrency-patterns)
|
||||
- [Advanced Go Concurrency Patterns](/blog/advanced-go-concurrency-patterns)
|
||||
([video](http://www.youtube.com/watch?v=QDDwwePbDtw)) covers more complex
|
||||
uses of Go's primitives,
|
||||
especially `select`.
|
||||
|
|
|
@ -12,7 +12,7 @@ summary: How the Go playground works.
|
|||
|
||||
_NOTE: This article does not describe the current version of the Go Playground._
|
||||
|
||||
In September 2010 we [introduced the Go Playground](https://blog.golang.org/introducing-go-playground),
|
||||
In September 2010 we [introduced the Go Playground](/blog/introducing-go-playground),
|
||||
a web service that compiles and executes arbitrary Go code and returns the
|
||||
program output.
|
||||
|
||||
|
@ -25,7 +25,7 @@ from the Go documentation.
|
|||
You may also have used it by clicking one of the "Run" buttons in a slide
|
||||
deck on [go.dev/talks](/talks/) or a post on this
|
||||
very blog
|
||||
(such as the [recent article on Strings](https://blog.golang.org/strings)).
|
||||
(such as the [recent article on Strings](/blog/strings)).
|
||||
|
||||
In this article we will take a look at how the playground is implemented
|
||||
and integrated with these services.
|
||||
|
|
|
@ -20,7 +20,7 @@ Google's language-neutral data interchange format.
|
|||
## Motivations for a new API
|
||||
|
||||
The first protocol buffer bindings for Go were
|
||||
[announced by Rob Pike](https://blog.golang.org/third-party-libraries-goprotobuf-and)
|
||||
[announced by Rob Pike](/blog/third-party-libraries-goprotobuf-and)
|
||||
in March of 2010. Go 1 would not be released for another two years.
|
||||
|
||||
In the decade since that first release, the package has grown and
|
||||
|
|
|
@ -36,7 +36,7 @@ This post uses [Git](https://git-scm.com/) in examples.
|
|||
|
||||
For this post, you'll need an existing project to use as an example. So, start
|
||||
with the files from the end of the
|
||||
[Using Go Modules](https://blog.golang.org/using-go-modules) article:
|
||||
[Using Go Modules](/blog/using-go-modules) article:
|
||||
|
||||
$ cat go.mod
|
||||
module example.com/hello
|
||||
|
@ -149,7 +149,7 @@ Do not delete version tags from your repo. If you find a bug or a security issue
|
|||
with a version, release a new version. If people depend on a version that you
|
||||
have deleted, their builds may fail. Similarly, once you release a version, do
|
||||
not change or overwrite it. The
|
||||
[module mirror and checksum database](https://blog.golang.org/module-mirror-launch)
|
||||
[module mirror and checksum database](/blog/module-mirror-launch)
|
||||
store modules, their versions, and signed cryptographic hashes to ensure that
|
||||
the build of a given version remains reproducible over time.
|
||||
|
||||
|
|
|
@ -557,7 +557,7 @@ were added to the language, they provided a model for efficient string handling.
|
|||
the benchmarks saw huge speedups as a result.
|
||||
|
||||
There's much more to strings, of course, and a
|
||||
[separate blog post](https://blog.golang.org/strings) covers them in greater depth.
|
||||
[separate blog post](/blog/strings) covers them in greater depth.
|
||||
|
||||
## Conclusion
|
||||
|
||||
|
@ -577,7 +577,7 @@ There's lots to find around the intertubes about slices in Go.
|
|||
As mentioned earlier,
|
||||
the ["Slice Tricks" Wiki page](/wiki/SliceTricks)
|
||||
has many examples.
|
||||
The [Go Slices](https://blog.golang.org/go-slices-usage-and-internals) blog post
|
||||
The [Go Slices](/blog/go-slices-usage-and-internals) blog post
|
||||
describes the memory layout details with clear diagrams.
|
||||
Russ Cox's [Go Data Structures](https://research.swtch.com/godata) article includes
|
||||
a discussion of slices along with some of Go's other internal data structures.
|
||||
|
|
|
@ -11,7 +11,7 @@ summary: Announcing the Go Collective, a new experience for Go on Stack Overflow
|
|||
|
||||
Since the earliest days of Go,
|
||||
Stack Overflow has been a significant part of the Go user experience.
|
||||
For the past five years, the [Go user survey](https://blog.golang.org/survey2020-results)
|
||||
For the past five years, the [Go user survey](/blog/survey2020-results)
|
||||
has consistently identified Stack Overflow as
|
||||
the #1 place users go to find answers to their Go questions.
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ summary: How strings work in Go, and how to use them.
|
|||
|
||||
## Introduction
|
||||
|
||||
The [previous blog post](https://blog.golang.org/slices) explained how slices
|
||||
The [previous blog post](/blog/slices) explained how slices
|
||||
work in Go, using a number of examples to illustrate the mechanism behind
|
||||
their implementation.
|
||||
Building on that background, this post discusses strings in Go.
|
||||
|
@ -41,7 +41,7 @@ Let's start with some basics.
|
|||
|
||||
In Go, a string is in effect a read-only slice of bytes.
|
||||
If you're at all uncertain about what a slice of bytes is or how it works,
|
||||
please read the [previous blog post](https://blog.golang.org/slices);
|
||||
please read the [previous blog post](/blog/slices);
|
||||
we'll assume here that you have.
|
||||
|
||||
It's important to state right up front that a string holds _arbitrary_ bytes.
|
||||
|
|
|
@ -16,7 +16,7 @@ and insights. It also draws key comparisons between the results of the 2016 and
|
|||
2017 survey.
|
||||
|
||||
This year we had 6,173 survey respondents, 70% more than the 3,595 we had in the
|
||||
[Go 2016 User Survey](https://blog.golang.org/survey2016-results). In
|
||||
[Go 2016 User Survey](/blog/survey2016-results). In
|
||||
addition, it also had a slightly higher completion rate (84% → 87%) and a
|
||||
higher response rate to most of the questions. We believe that survey length is
|
||||
the main cause of this improvement as the 2017 survey was shortened in response
|
||||
|
@ -144,7 +144,7 @@ continues to be an area of focus for the project and its leadership going
|
|||
forward. We will continue to work to improve our understanding of user needs and
|
||||
approachability.
|
||||
|
||||
We tried some [new ways](https://blog.golang.org/8years#TOC_1.3.) to engage
|
||||
We tried some [new ways](/blog/8years#TOC_1.3.) to engage
|
||||
with users in 2017 and while progress was made, we are still working on making these
|
||||
solutions scalable for our growing community.
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ summary: Please take the 2017 Go User Survey. We want to hear from you!
|
|||
## The Go project wants to hear from you (again)!
|
||||
|
||||
Last year we conducted the first ever
|
||||
[Go user survey](https://blog.golang.org/survey2016-results). Thanks to all of you,
|
||||
[Go user survey](/blog/survey2016-results). Thanks to all of you,
|
||||
it was an overwhelming success with over 3500 responses. The survey provided key insights
|
||||
and helped us better plan and prioritize.
|
||||
|
||||
|
@ -34,7 +34,7 @@ and what's not, as well as help us prioritize improvements for the Go
|
|||
language, libraries and tools.
|
||||
|
||||
A few weeks after the survey closes, we will publish the anonymous aggregate results to
|
||||
the Go blog. See the [2016 Go user survey results](https://blog.golang.org/survey2016-results)
|
||||
the Go blog. See the [2016 Go user survey results](/blog/survey2016-results)
|
||||
to learn what insights were gained from last year's survey.
|
||||
|
||||
## Spread the word!
|
||||
|
|
|
@ -19,8 +19,8 @@ summary: What we learned from the December 2018 Go User Survey.
|
|||
</style>
|
||||
|
||||
This post summarizes the results of our 2018 user survey and draws comparisons
|
||||
between the results of our prior surveys from [2016](https://blog.golang.org/survey2016-results)
|
||||
and [2017](https://blog.golang.org/survey2017-results).
|
||||
between the results of our prior surveys from [2016](/blog/survey2016-results)
|
||||
and [2017](/blog/survey2017-results).
|
||||
|
||||
This year we had 5,883 survey respondents from 103 different countries.
|
||||
We are grateful to everyone who provided their feedback through this survey
|
||||
|
|
|
@ -11,14 +11,14 @@ summary: Please take the 2018 Go User Survey. We want to hear from you!
|
|||
|
||||
## The Go project wants to hear from you, the Go community!
|
||||
|
||||
In [2017](https://blog.golang.org/survey2017-results) &
|
||||
[2016](https://blog.golang.org/survey2016-results), thousands of you helped the
|
||||
In [2017](/blog/survey2017-results) &
|
||||
[2016](/blog/survey2016-results), thousands of you helped the
|
||||
project by lending your voice via the Go user survey. In October, hundreds of
|
||||
companies helped us understand how enterprises are using Go by taking the Go company
|
||||
questionnaire. These surveys and questionnaires have played an enormous role in
|
||||
driving changes to our language and community, from
|
||||
[our new code of conduct](https://blog.golang.org/conduct-2018), to our
|
||||
[latest release Go 1.11](https://blog.golang.org/go1.11).
|
||||
[our new code of conduct](/blog/conduct-2018), to our
|
||||
[latest release Go 1.11](/blog/go1.11).
|
||||
|
||||
Today we are conducting the 2018 Go user survey. We’d like to hear from **all** Go
|
||||
users in order to help us to create the best programming language that fits the
|
||||
|
|
|
@ -13,7 +13,7 @@ summary: An analysis of the results from the 2019 Go Developer Survey.
|
|||
|
||||
I want to start with an enormous **thank you** to the thousands of Go developers
|
||||
who participated in this year’s survey.
|
||||
For 2019, we saw 10,975 responses, nearly [twice as many as last year](https://blog.golang.org/survey2018-results)!
|
||||
For 2019, we saw 10,975 responses, nearly [twice as many as last year](/blog/survey2018-results)!
|
||||
On behalf of the rest of the team, I cannot adequately stress how much we
|
||||
appreciate you taking the time and effort to tell us about your experiences with Go. Thank you!
|
||||
|
||||
|
|
|
@ -15,11 +15,11 @@ Since 2016, thousands of Gophers around the world have helped the Go project
|
|||
by sharing your thoughts via our annual Go Developer Survey.
|
||||
Your feedback has played an enormous role in driving changes to our language,
|
||||
ecosystem, and community, including [the gopls language server](https://about.sourcegraph.com/go/gophercon-2019-go-pls-stop-breaking-my-editor),
|
||||
new [error-handling mechanics](https://blog.golang.org/go1.13-errors),
|
||||
the [module mirror](https://blog.golang.org/module-mirror-launch),
|
||||
and so much more from the latest [Go 1.13 release](https://blog.golang.org/go1.13).
|
||||
And of course, we publicly share [each](https://blog.golang.org/survey2016-results)
|
||||
[year's](https://blog.golang.org/survey2017-results) [results](https://blog.golang.org/survey2018-results),
|
||||
new [error-handling mechanics](/blog/go1.13-errors),
|
||||
the [module mirror](/blog/module-mirror-launch),
|
||||
and so much more from the latest [Go 1.13 release](/blog/go1.13).
|
||||
And of course, we publicly share [each](/blog/survey2016-results)
|
||||
[year's](/blog/survey2017-results) [results](/blog/survey2018-results),
|
||||
so we can all benefit from the community's insights.
|
||||
|
||||
Today we are launching the 2019 Go Developer Survey.
|
||||
|
|
|
@ -11,7 +11,7 @@ summary: An analysis of the results from the 2020 Go Developer Survey.
|
|||
|
||||
## Thank you for the amazing response! {#thanks}
|
||||
|
||||
In 2020, we had another great turnout with 9,648 responses, about [as many as 2019](https://blog.golang.org/survey2019-results). Thank you for putting in the time to provide the community with these insights on your experiences using Go!
|
||||
In 2020, we had another great turnout with 9,648 responses, about [as many as 2019](/blog/survey2019-results). Thank you for putting in the time to provide the community with these insights on your experiences using Go!
|
||||
|
||||
## New modular survey design {#new}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ by sharing their thoughts via our annual Go Developer Survey.
|
|||
Your feedback has played an enormous role in driving changes to our language,
|
||||
ecosystem, and community, including the gopls language server,
|
||||
the latest generics draft, the module mirror, and so much more.
|
||||
And of course, we publicly share [each year's results](https://blog.golang.org/survey2019-results),
|
||||
And of course, we publicly share [each year's results](/blog/survey2019-results),
|
||||
so we can all benefit from the community's insights.
|
||||
|
||||
This year we’ve streamlined the survey to shorten the time it takes to
|
||||
|
|
|
@ -33,14 +33,14 @@ to the [open-source release](https://opensource.googleblog.com/2009/11/hey-ho-le
|
|||
|
||||
For the next two years, with the help of the new Go open source
|
||||
community, we experimented with changes large and small, refining Go
|
||||
and leading to the [plan for Go 1](https://blog.golang.org/preview-of-go-version-1), proposed on October 5, 2011.
|
||||
and leading to the [plan for Go 1](/blog/preview-of-go-version-1), proposed on October 5, 2011.
|
||||
|
||||
<div style="margin-left: 2em;">
|
||||
{{image "toward-go2/go1-preview.png" 560}}
|
||||
</div>
|
||||
|
||||
With more help from the Go community, we revised and implemented that
|
||||
plan, eventually [releasing Go 1](https://blog.golang.org/go1) on March 28, 2012.
|
||||
plan, eventually [releasing Go 1](/blog/go1) on March 28, 2012.
|
||||
|
||||
<div style="margin-left: 2em;">
|
||||
{{image "toward-go2/go1-release.png" 556}}
|
||||
|
@ -55,7 +55,7 @@ In the years leading to Go 1, we changed Go and broke everyone's Go
|
|||
programs nearly every week. We understood that this was keeping Go
|
||||
from use in production settings, where programs could not be rewritten
|
||||
weekly to keep up with language changes.
|
||||
As the [blog post announcing Go 1](https://blog.golang.org/go1) says, the driving motivation was to provide a stable foundation
|
||||
As the [blog post announcing Go 1](/blog/go1) says, the driving motivation was to provide a stable foundation
|
||||
for creating reliable products, projects, and publications (blogs,
|
||||
tutorials, conference talks, and books), to make users confident that
|
||||
their programs would continue to compile and run without change for
|
||||
|
@ -67,7 +67,7 @@ explicitly away from making language changes toward using Go in our
|
|||
own projects and improving the implementation: we ported Go to many
|
||||
new systems, we rewrote nearly every performance-critical piece to
|
||||
make Go run more efficiently, and we added key tools like the
|
||||
[race detector](https://blog.golang.org/race-detector).
|
||||
[race detector](/blog/race-detector).
|
||||
|
||||
Now we have five years of experience using Go to build large,
|
||||
production-quality systems. We have developed a sense of what works
|
||||
|
@ -104,7 +104,7 @@ scale.
|
|||
|
||||
(For more about these goals, see
|
||||
Rob Pike's 2012 article “[Go at Google: Language Design in the Service of Software Engineering](/talks/2012/splash.article)”
|
||||
and my GopherCon 2015 talk “[Go, Open Source, Community](https://blog.golang.org/open-source).”)
|
||||
and my GopherCon 2015 talk “[Go, Open Source, Community](/blog/open-source).”)
|
||||
|
||||
## Constraints
|
||||
|
||||
|
@ -206,7 +206,7 @@ explained step 2 in detail, so I'd like to do that now.
|
|||
|
||||
(For more about the development of Go 1 and the shift away from
|
||||
language changes, see Rob Pike and Andrew Gerrand's
|
||||
OSCON 2012 talk “[The Path to Go 1](https://blog.golang.org/the-path-to-go-1).”
|
||||
OSCON 2012 talk “[The Path to Go 1](/blog/the-path-to-go-1).”
|
||||
For more about the proposal process, see
|
||||
Andrew Gerrand's GopherCon 2015 talk “[How Go was Made](https://www.youtube.com/watch?v=0ht89TxZZnk)” and the
|
||||
[proposal process documentation](/s/proposal).)
|
||||
|
@ -512,7 +512,7 @@ to find some way to disallow data races, to make it impossible to
|
|||
write or at least to compile a program with a data race. How to fit
|
||||
that into a language like Go is still an open question in the
|
||||
programming language world. Instead we added a tool to the main
|
||||
distribution and made it trivial to use: that tool, the [race detector](https://blog.golang.org/race-detector), has become
|
||||
distribution and made it trivial to use: that tool, the [race detector](/blog/race-detector), has become
|
||||
an indispensable part of the Go experience. Here the best solution was
|
||||
a runtime and tooling change, not a language change.
|
||||
|
||||
|
|
|
@ -273,7 +273,7 @@ making it easier to learn good style and conventions.
|
|||
In writing this application I used just three resources:
|
||||
App Engine's [Hello World Go example](http://code.google.com/appengine/docs/go/gettingstarted/helloworld.html),
|
||||
[the Go packages documentation](/pkg/),
|
||||
and [a blog post showcasing the Draw package](https://blog.golang.org/2011/09/go-imagedraw-package.html).
|
||||
and [a blog post showcasing the Draw package](/blog/2011/09/go-imagedraw-package.html).
|
||||
Thanks to the rapid iteration made possible by the development server and
|
||||
the language itself,
|
||||
I was able to pick up the language and build a super fast,
|
||||
|
|
|
@ -26,7 +26,7 @@ This post is part 1 in a series.
|
|||
Go 1.11 and 1.12 include preliminary
|
||||
[support for modules](/doc/go1.11#modules),
|
||||
Go’s
|
||||
[new dependency management system](https://blog.golang.org/versioning-proposal)
|
||||
[new dependency management system](/blog/versioning-proposal)
|
||||
that makes dependency version information explicit
|
||||
and easier to manage.
|
||||
This blog post is an introduction to the basic operations needed
|
||||
|
|
|
@ -40,7 +40,7 @@ some of the details, especially concerning backwards compatibility.
|
|||
## The Impact of Compatibility
|
||||
|
||||
The most important new feature of
|
||||
[Go 1](https://blog.golang.org/preview-of-go-version-1)
|
||||
[Go 1](/blog/preview-of-go-version-1)
|
||||
was not a language feature.
|
||||
It was Go 1’s emphasis on backwards compatibility.
|
||||
Until that point we’d issued stable release
|
||||
|
|
|
@ -20,7 +20,7 @@ success can be attributed to the fantastic development tools created by the Go
|
|||
community. The
|
||||
[VS Code extension for Go](https://github.com/microsoft/vscode-go), built using
|
||||
many of these tools, is now used by 41 percent of Go developers
|
||||
([Go developer survey](https://blog.golang.org/survey2019-results)).
|
||||
([Go developer survey](/blog/survey2019-results)).
|
||||
|
||||
As the VS Code Go extension grows in popularity and as
|
||||
[the ecosystem expands](https://www.youtube.com/watch?v=EFJfdWzBHwE), it
|
||||
|
|
|
@ -8,7 +8,7 @@ summary: How to use Wire, a dependency injection tool for Go.
|
|||
|
||||
## Overview
|
||||
|
||||
The Go team recently [announced](https://blog.golang.org/go-cloud) the
|
||||
The Go team recently [announced](/blog/go-cloud) the
|
||||
open source project [Go Cloud](https://github.com/google/go-cloud),
|
||||
with portable Cloud APIs and tools for [open cloud](https://cloud.google.com/open-cloud/) development.
|
||||
This post goes into more detail about Wire,
|
||||
|
|
|
@ -38,7 +38,7 @@ The third goal of the Code of Conduct is to make our community welcoming to
|
|||
people from different backgrounds.
|
||||
Diversity is critical to the project; for Go to be successful, it needs
|
||||
contributors and users from all backgrounds.
|
||||
(See <a href="https://blog.golang.org/open-source">Go, Open Source, Community</a>.)
|
||||
(See <a href="/blog/open-source">Go, Open Source, Community</a>.)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
|
|
@ -9,7 +9,7 @@ represents has been canceled and is no longer needed. By passing a
|
|||
`context.Context` across function calls and services in your application, those
|
||||
can stop working early and return an error when their processing is no longer
|
||||
needed. For more about `Context`, see
|
||||
[Go Concurrency Patterns: Context](https://blog.golang.org/context).
|
||||
[Go Concurrency Patterns: Context](/blog/context).
|
||||
|
||||
For example, you might want to:
|
||||
|
||||
|
|
|
@ -316,7 +316,7 @@ future changes to the libraries.
|
|||
Gofix can’t
|
||||
handle all situations perfectly, so read and test the changes it makes before
|
||||
committing them.
|
||||
See <a href="https://blog.golang.org/2011/04/introducing-gofix.html">the gofix blog post</a> for more
|
||||
See <a href="/blog/2011/04/introducing-gofix.html">the gofix blog post</a> for more
|
||||
information.</p>
|
||||
|
||||
<h3 id="r57.lang">Language</h3>
|
||||
|
|
|
@ -128,7 +128,7 @@ so it is recommended to collect only a single profile at a time.
|
|||
The Go tools provide text, graph, and <a href="http://valgrind.org/docs/manual/cl-manual.html">callgrind</a>
|
||||
visualization of the profile data using
|
||||
<code><a href="https://github.com/google/pprof/blob/master/doc/README.md">go tool pprof</a></code>.
|
||||
Read <a href="https://blog.golang.org/profiling-go-programs">Profiling Go programs</a>
|
||||
Read <a href="/blog/profiling-go-programs">Profiling Go programs</a>
|
||||
to see them in action.
|
||||
</p>
|
||||
|
||||
|
|
|
@ -3098,7 +3098,7 @@ Although the concurrency features of Go can make some problems easy
|
|||
to structure as parallel computations, Go is a concurrent language,
|
||||
not a parallel one, and not all parallelization problems fit Go's model.
|
||||
For a discussion of the distinction, see the talk cited in
|
||||
<a href="https://blog.golang.org/2013/01/concurrency-is-not-parallelism.html">this
|
||||
<a href="/blog/2013/01/concurrency-is-not-parallelism.html">this
|
||||
blog post</a>.
|
||||
|
||||
<h3 id="leaky_buffer">A leaky buffer</h3>
|
||||
|
|
|
@ -90,7 +90,7 @@ The mascot and logo were designed by
|
|||
<a href="https://reneefrench.blogspot.com">Renée French</a>, who also designed
|
||||
<a href="https://9p.io/plan9/glenda.html">Glenda</a>,
|
||||
the Plan 9 bunny.
|
||||
A <a href="https://blog.golang.org/gopher">blog post</a>
|
||||
A <a href="/blog/gopher">blog post</a>
|
||||
about the gopher explains how it was
|
||||
derived from one she used for a <a href="https://wfmu.org/">WFMU</a>
|
||||
T-shirt design some years ago.
|
||||
|
@ -125,7 +125,7 @@ The language's name is just plain Go, regardless.
|
|||
|
||||
<p>
|
||||
A side note: Although the
|
||||
<a href="https://blog.golang.org/go-brand">official logo</a>
|
||||
<a href="/blog/go-brand">official logo</a>
|
||||
has two capital letters, the language name is written Go, not GO.
|
||||
</p>
|
||||
|
||||
|
@ -502,7 +502,7 @@ when used well, can result in clean error-handling code.
|
|||
|
||||
<p>
|
||||
See the <a href="/doc/articles/defer_panic_recover.html">Defer, Panic, and Recover</a> article for details.
|
||||
Also, the <a href="https://blog.golang.org/errors-are-values">Errors are values</a> blog post
|
||||
Also, the <a href="/blog/errors-are-values">Errors are values</a> blog post
|
||||
describes one approach to handling errors cleanly in Go by demonstrating that,
|
||||
since errors are just values, the full power of Go can be deployed in error handling.
|
||||
</p>
|
||||
|
@ -1150,7 +1150,7 @@ to a <code>float64</code> for the call to <code>math.Sqrt</code>.
|
|||
</p>
|
||||
|
||||
<p>
|
||||
A blog post titled <a href="https://blog.golang.org/constants">Constants</a>
|
||||
A blog post titled <a href="/blog/constants">Constants</a>
|
||||
explores this topic in more detail.
|
||||
</p>
|
||||
|
||||
|
@ -1626,7 +1626,7 @@ Do not communicate by sharing memory. Instead, share memory by communicating.
|
|||
|
||||
<p>
|
||||
See the <a href="/doc/codewalk/sharemem/">Share Memory By Communicating</a> code walk
|
||||
and its <a href="https://blog.golang.org/2010/07/share-memory-by-communicating.html">
|
||||
and its <a href="/blog/2010/07/share-memory-by-communicating.html">
|
||||
associated article</a> for a detailed discussion of this concept.
|
||||
</p>
|
||||
|
||||
|
@ -1665,7 +1665,7 @@ to speed it up.
|
|||
|
||||
<p>
|
||||
For more detail on this topic see the talk entitled
|
||||
<a href="https://blog.golang.org/2013/01/concurrency-is-not-parallelism.html">Concurrency
|
||||
<a href="/blog/2013/01/concurrency-is-not-parallelism.html">Concurrency
|
||||
is not Parallelism</a>.
|
||||
|
||||
<h3 id="number_cpus">
|
||||
|
@ -2506,7 +2506,7 @@ In any case, Go can often be very competitive.
|
|||
There has been significant improvement in the performance of many programs
|
||||
as the language and tools have developed.
|
||||
See the blog post about
|
||||
<a href="https://blog.golang.org/2011/06/profiling-go-programs.html">profiling
|
||||
<a href="/blog/2011/06/profiling-go-programs.html">profiling
|
||||
Go programs</a> for an informative example.
|
||||
|
||||
<h2 id="change_from_c">Changes from C</h2>
|
||||
|
@ -2684,7 +2684,7 @@ in networked servers.
|
|||
Work continues to refine the algorithm, reduce overhead and
|
||||
latency further, and to explore new approaches.
|
||||
The 2018
|
||||
<a href="https://blog.golang.org/ismmkeynote">ISMM keynote</a>
|
||||
<a href="/blog/ismmkeynote">ISMM keynote</a>
|
||||
by Rick Hudson of the Go team
|
||||
describes the progress so far and suggests some future approaches.
|
||||
</p>
|
||||
|
@ -2695,7 +2695,7 @@ considerable control over memory layout and allocation, much more than
|
|||
is typical in garbage-collected languages. A careful programmer can reduce
|
||||
the garbage collection overhead dramatically by using the language well;
|
||||
see the article about
|
||||
<a href="https://blog.golang.org/2011/06/profiling-go-programs.html">profiling
|
||||
<a href="/blog/2011/06/profiling-go-programs.html">profiling
|
||||
Go programs</a> for a worked example, including a demonstration of Go's
|
||||
profiling tools.
|
||||
</p>
|
||||
|
|
|
@ -23,7 +23,7 @@ We expect almost all Go programs to continue to compile and run as before.
|
|||
|
||||
Module support in the `go` command is now ready for production use,
|
||||
and we encourage all users to [migrate to Go
|
||||
modules for dependency management](https://blog.golang.org/migrating-to-go-modules). If you are unable to migrate due to a problem in the Go
|
||||
modules for dependency management](/blog/migrating-to-go-modules). If you are unable to migrate due to a problem in the Go
|
||||
toolchain, please ensure that the problem has an
|
||||
[open issue](/issue?q=is%3Aissue+is%3Aopen+label%3Amodules)
|
||||
filed. (If the issue is not on the `Go1.15` milestone, please let us
|
||||
|
|
|
@ -747,7 +747,7 @@ The fixes harden the implementation against incorrect and malicious inputs.
|
|||
`uint8(r>>8)`.
|
||||
Incidentally, the `image/draw` package
|
||||
provides better support for such conversions; see
|
||||
[this blog post](https://blog.golang.org/go-imagedraw-package)
|
||||
[this blog post](/blog/go-imagedraw-package)
|
||||
for more information.
|
||||
- Finally, as of Go 1.5 the closest match check in
|
||||
[`Index`](/pkg/image/color/#Palette.Index)
|
||||
|
|
|
@ -227,7 +227,7 @@ reading or writing the map concurrently.
|
|||
If the runtime detects this condition, it prints a diagnosis and crashes the program.
|
||||
The best way to find out more about the problem is to run the program
|
||||
under the
|
||||
[race detector](https://blog.golang.org/race-detector),
|
||||
[race detector](/blog/race-detector),
|
||||
which will more reliably identify the race
|
||||
and give more detail.
|
||||
|
||||
|
|
|
@ -322,7 +322,7 @@ as noted below.
|
|||
For more information about contexts, see the
|
||||
[package documentation](/pkg/context/)
|
||||
and the Go blog post
|
||||
“[Go Concurrent Patterns: Context](https://blog.golang.org/context).”
|
||||
“[Go Concurrent Patterns: Context](/blog/context).”
|
||||
|
||||
### HTTP Tracing {#httptrace}
|
||||
|
||||
|
|
|
@ -410,7 +410,7 @@ reading (which includes iterating) or writing the map concurrently.
|
|||
If the runtime detects this condition, it prints a diagnosis and crashes the program.
|
||||
The best way to find out more about the problem is to run the program
|
||||
under the
|
||||
[race detector](https://blog.golang.org/race-detector),
|
||||
[race detector](/blog/race-detector),
|
||||
which will more reliably identify the race
|
||||
and give more detail.
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ Also, designing and developing your module with backward compatibility in mind
|
|||
helps its users upgrade while minimizing churn to their own code. You can use
|
||||
certain techniques in code to avoid releasing a version that breaks backward
|
||||
compatibility. For more about those techniques, see [Keeping your modules
|
||||
compatible](https://blog.golang.org/module-compatibility) on the Go blog.
|
||||
compatible](/blog/module-compatibility) on the Go blog.
|
||||
|
||||
Before you publish a module, you can reference it on the local file system using
|
||||
the replace directive. This makes it easier to write client code that calls
|
||||
|
|
|
@ -253,7 +253,7 @@ Given the disruptive effect a major version upgrade can have on code relying on
|
|||
the module, you should avoid a major version update if you can. For more about
|
||||
major version updates, see [Developing a major version update](/doc/modules/major-version).
|
||||
For strategies to avoid making breaking changes, see the blog post [Keeping your
|
||||
modules compatible](https://blog.golang.org/module-compatibility).
|
||||
modules compatible](/blog/module-compatibility).
|
||||
|
||||
Where publishing other kinds of versions requires essentially tagging the module
|
||||
code with the version number, publishing a major version update requires more
|
||||
|
|
|
@ -109,7 +109,7 @@ func randomFormat() string {
|
|||
you initialize a map with the following syntax:
|
||||
<code>make(map[<em>key-type</em>]<em>value-type</em>)</code>. You have
|
||||
the <code>Hellos</code> function return this map to the caller. For more
|
||||
about maps, see <a href="https://blog.golang.org/maps">Go maps in
|
||||
about maps, see <a href="/blog/maps">Go maps in
|
||||
action</a> on the Go blog.
|
||||
</li>
|
||||
<li>
|
||||
|
@ -202,7 +202,7 @@ map[Darrin:Hail, Darrin! Well met! Gladys:Hi, Gladys. Welcome! Samantha:Hail, Sa
|
|||
introduced the idea of preserving backward compatibility
|
||||
by implementing a new function for new or changed functionality in a module.
|
||||
For more about backward compatibility, see
|
||||
<a href="https://blog.golang.org/module-compatibility">Keeping your modules
|
||||
<a href="/blog/module-compatibility">Keeping your modules
|
||||
compatible</a>.
|
||||
</p>
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<p>
|
||||
You'll add a small slice to contain three greeting messages, then have your
|
||||
code return one of the messages randomly. For more on slices,
|
||||
see <a href="https://blog.golang.org/slices-intro">Go slices</a> in the Go
|
||||
see <a href="/blog/slices-intro">Go slices</a> in the Go
|
||||
blog.
|
||||
</p>
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ This document is a detailed reference manual for Go's module system. For an
|
|||
introduction to creating Go projects, see [How to Write Go
|
||||
Code](/doc/code.html). For information on using modules,
|
||||
migrating projects to modules, and other topics, see the blog series starting
|
||||
with [Using Go Modules](https://blog.golang.org/using-go-modules).
|
||||
with [Using Go Modules](/blog/using-go-modules).
|
||||
|
||||
## Modules, packages, and versions {#modules-overview}
|
||||
|
||||
|
@ -1369,7 +1369,7 @@ usually release a new major version. In the example above, the author should
|
|||
create a module with the path `example.com/m/v5` and should release version
|
||||
`v5.0.0`. The author should also update imports of packages in the module to use
|
||||
the prefix `example.com/m/v5` instead of `example.com/m`. See [Go Modules: v2
|
||||
and Beyond](https://blog.golang.org/v2-go-modules) for a more detailed example.
|
||||
and Beyond](/blog/v2-go-modules) for a more detailed example.
|
||||
|
||||
Note that the `+incompatible` suffix should not appear on a tag in a repository;
|
||||
a tag like `v4.1.2+incompatible` will be ignored. The suffix only appears in
|
||||
|
|
Загрузка…
Ссылка в новой задаче