Change-Id: I0754d18f4c3c3d5dfa0c34b4bc154a35ac20b917
Reviewed-on: https://go-review.googlesource.com/c/website/+/411794
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
This commit is contained in:
Frederik Zipp 2022-06-12 20:19:30 +02:00 коммит произвёл Gopher Robot
Родитель 08809b7f2b
Коммит 4056b246ea
80 изменённых файлов: 130 добавлений и 124 удалений

Просмотреть файл

@ -137,7 +137,7 @@ Many of these authors have said that their projects would not exist without
Go. Some like Kubernetes and Docker created entirely new solutions. Others
like Hugo, Syncthing and Fzf created more refined experiences where many
solutions already existed. The popularity of these applications alone is
proof that Go is a ideal language for a broad set of use cases.
proof that Go is an ideal language for a broad set of use cases.
## Thank You

Просмотреть файл

@ -141,7 +141,7 @@ It is identical to the code listing above,
and requires no build constraints as it should be included in all versions of the program.
main.go runs the web server. It includes the "!appengine" build constraint,
as it must only included when building the stand-alone binary.
as it must only be included when building the stand-alone binary.
// +build !appengine

Просмотреть файл

@ -66,7 +66,7 @@ documentation. The [Go User survey](https://blog.golang.org/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
(with specific naming) and the `go doc` tool displays them along side the documentation.
(with specific naming) and the `go doc` tool displays them alongside the documentation.
This is a perfect first contribution as it's something that can be merged
during a freeze, it's of critical importance to our users, and it's an addition
that has a relatively narrow scope.
@ -85,7 +85,7 @@ In addition to examples, many people contributed critical bug fixes including:
Some people even surprised us by arriving with a bug in mind that they wanted
to fix. Nikhita arrived ready to tackle
[issue #20786](/issue/20786)
and she did submitting
and she did submit
[CL 48871](/cl/48871/),
after which she tweeted:
@ -180,7 +180,7 @@ I've always found programming languages to be intimidating. It's the code that
enables the world to write code. Given the impact, surely smarter people than
me should be working on it... but that fear was something to overcome. So when
the opportunity to join a workshop to contribute to my new favorite programming
language came up, I was excite to see how I could and how I could help. A month
language came up, I was excited to see how I could help. A month
later, I'm now certain that anyone and everyone can (and should) contribute back to Go.
Here are my very verbose steps to go from 0 to 2 contributions to Go:
@ -211,7 +211,7 @@ Next, install `codereview` so you can participate in a Gerrit code review:
This package includes `git change` and `git mail` which will replace your
normal workflow of `git commit` and `git push` respectively.
Okay, installations are out of the way. Now setup your [Gerrit account here](https://go-review.googlesource.com/settings/#Profile),
Okay, installations are out of the way. Now set up your [Gerrit account here](https://go-review.googlesource.com/settings/#Profile),
then [sign the CLA](https://go-review.googlesource.com/settings#Agreements) appropriate for
you (I signed a personal one for all Google projects, but choose the right option for you.
You can see all CLAs you've signed at [cla.developers.google.com/clas](https://cla.developers.google.com/clas)).
@ -243,7 +243,7 @@ if you need to update your patch you can `add` then `change` and it will all
link to the same patch. Secondly, you can always review your patch from your
[personal Gerrit dashboard](https://go-review.googlesource.com/dashboard/).
After a few back and forths, I officially had a contribute to Go! And if Jaana
After a few back and forths, I officially had a contribution to Go! And if Jaana
is right, it might be the first with emojis ✌️.
{{image "contributor-workshop/image15.png"}}
@ -330,7 +330,7 @@ dedicate an entire day of an upcoming weekend to figuring out the process. I
set aside all of Saturday for doing one thing: sending my first CL to Go. I
opened up [the Contribution Guide](/doc/contribute.html)
and started following all the steps, from the very top. Within an hour, I was
done. I had send my first CL. I was both in awe and shock. In awe, because I
done. I had sent my first CL. I was both in awe and shock. In awe, because I
had finally sent a contribution to Go, and it was accepted! In shock, because,
why did I wait so long to finally do this? Following the steps in
[the Contribution Guide](/doc/contribute.html) was very

Просмотреть файл

@ -169,7 +169,7 @@ A lot of people with lots of interest in lots of tools!
The session focused on two areas (all that time allowed): gopls and visualizations.
[Gopls](/wiki/gopls) (pronounced: “go please”) is an implementation of the
[Language Server Protocol (LSP)](https://langserver.org) server for Go.
Rebecca Stamber, the gopls lead author, and the rest of the Go tools team were interested
Rebecca Stambler, the gopls lead author, and the rest of the Go tools team were interested
in hearing peoples experiences with gopls: stability, missing features, integrations in editors working, etc?
The general feeling was that gopls was in really good shape and working extremely well for the majority of use cases.
Integration test coverage needs to be improved, but this is a hard problem to get “right” across all editors.
@ -268,7 +268,7 @@ But rather we should be aware of untapped potential and unrecognized
hindrances in the Go language and ecosystem.
While several different possibilities to actively solicit this information
from the outside was discussed, this is a problem we fundamentally need your help.
from the outside were discussed, this is a problem we fundamentally need your help.
If you are in an organization that doesnt use Go even though it was considered,
let us know why Go wasnt chosen.
If you are in an organization where Go is only used for a subsection of programming tasks,
@ -381,7 +381,7 @@ Cite them?
We agreed that a portal-like-solution (of external links to resources)
makes navigation difficult and takes away from the learning experience,
which led us to the conclusion that such contribution cannot be passive,
and contributors will likely have to opt-in to have their material on the platform.
and contributors will likely have to opt in to have their material on the platform.
There was then much excitement around the idea of adding a voting mechanism to the platform,
effectively turning the learners into contributors, too,
and incentivizing the contributors to put their materials on the platform.

Просмотреть файл

@ -187,7 +187,7 @@ Given the `errWriter` type and its `write` method, the code above can be refacto
This is cleaner, even compared to the use of a closure,
and also makes the actual sequence of writes being done easier to see on the page.
There is no clutter any more.
There is no clutter anymore.
Programming with error values (and interfaces) has made the code nicer.
It's likely that some other piece of code in the same package can build on this idea,

Просмотреть файл

@ -97,7 +97,7 @@ testflag` if you want more information.
Also be aware that the fuzzing engine writes values that expand test coverage to
a fuzz cache directory within `$GOCACHE/fuzz` while it runs. There is currently
no limit to the number of files or total bytes that may be written to the fuzz
cache, so it may occupy a large amount of storage (ie. several GBs). You can
cache, so it may occupy a large amount of storage (i.e. several GBs). You can
clear the fuzz cache by running `gotip clean -fuzzcache`.
## Whats next?

Просмотреть файл

@ -62,8 +62,8 @@ welcome to use this theme for their own presentations.
{{image "go-brand/go-slides-4up.jpg"}}
The presentations are available as Google Slides presentations. We chose Google
slides as it is easy to share and maintain updates. People are welcome to port
them to keynote, powerpoint, etc.
Slides as it is easy to share and maintain updates. People are welcome to port
them to Keynote, PowerPoint, etc.
Like this blog and all our gopher images,
the slide themes are Creative Commons Attribution 3.0 licensed.
@ -72,8 +72,8 @@ The photos in the slides are all from
Instructions to use slides:
- Open the [Go Slide Masters](/s/presentation-theme) presentation on Google slides.
- File > “Make a Copy” (you may need to login first)
- Open the [Go Slide Masters](/s/presentation-theme) presentation on Google Slides.
- File > “Make a Copy” (you may need to log in first)
- Create new slides using the layouts provided in the layouts menu.
- Use the included example slides to help guide the styling and creation of your presentation.

Просмотреть файл

@ -225,7 +225,7 @@ bold stem thickness is 1.5 times thicker than the normal weight, hence
the Bold Mono has the same stem thickness as Bold Go proportional.
Because the letter width of monospaced bold is identical to the width of
monospaced normal, the bold Mono appears slightly bolder than the
proportional Go Bold, as more black pixels are put into the same area.)
proportional Go Bold, as more black pixels are put into the same area.
### Metric compatibility with popular monospaced fonts

Просмотреть файл

@ -4,7 +4,7 @@ date: 2021-02-16
by:
- Matt Pearring
- Dmitri Shuralyov
summary: Go 1.16 adds embedded files, Apple silicon support, and more.
summary: Go 1.16 adds embedded files, Apple Silicon support, and more.
---

Просмотреть файл

@ -156,4 +156,4 @@ Per the
the final decision will be
made at the end of the development cycle (beginning of November, 2019).
Thank you for helping making Go a better language!
Thank you for helping make Go a better language!

Просмотреть файл

@ -16,7 +16,7 @@ by default, to deliver more robust IDE features and better support for Go
modules.
{{image "gopls/features.gif" 635}}
_(`gopls` provides IDE features, such as as intelligent autocompletion, signature help, refactoring, and workspace symbol search.)_
_(`gopls` provides IDE features, such as intelligent autocompletion, signature help, refactoring, and workspace symbol search.)_
When [Go modules](using-go-modules) were
released two years ago, they completely changed the landscape of Go developer

Просмотреть файл

@ -55,7 +55,7 @@ Two more talks come from the Go meetup in New York City, which met the day befor
- [Benchmarking Go](http://vimeo.com/114975899) _by_ [_Brian Bulkowski_](https://twitter.com/bbulkow) -
the founder of Aerospike talks about profiling tools for Go and Linux,
and micro benchmarks for goroutines, channels,
buffers, and and other Go features.
buffers, and other Go features.
- [Go Static Analysis Tools](http://vimeo.com/114736889) _by Alan Donovan_ -
a member of the Go team at Google NY gives a guided tour of several static
analysis tools designed to help Go programmers understand,

Просмотреть файл

@ -35,7 +35,7 @@ Generics are a way of writing code that is independent of the specific
types being used.
Functions and types may now be written to use any of a set of types.
Generics adds three new big things to the language:
Generics add three new big things to the language:
1. Type parameters for function and types.
2. Defining interface types as sets of types, including types that
don't have methods.
@ -441,7 +441,7 @@ for `E`.
This was just an introduction to constraint type inference.
For full details see the [proposal
document](https://go.googlesource.com/proposal/+/HEAD/design/43651-type-parameters.md)
document or the [language spec](/ref/spec).
or the [language spec](/ref/spec).
### Type inference in practice

Просмотреть файл

@ -102,8 +102,8 @@ continue, but no major changes to the interface of `database/sql` are planned.
assist some drivers.
_What is the status of versioning?_
_Is importing some code from github a best practice recommended by the Go team?_
_What happens when we publish our code that is dependent on a github repo and_
_Is importing some code from GitHub a best practice recommended by the Go team?_
_What happens when we publish our code that is dependent on a GitHub repo and_
_the API of the dependee changes?_
**Ian:** This is frequently discussed on the mailing list. What we do internally

Просмотреть файл

@ -62,7 +62,7 @@ Only data structures that can be represented as valid JSON will be encoded:
The json package only accesses the exported fields of struct types (those
that begin with an uppercase letter).
Therefore only the the exported fields of a struct will be present in the JSON output.
Therefore only the exported fields of a struct will be present in the JSON output.
## Decoding

Просмотреть файл

@ -25,7 +25,7 @@ should be taken to mean "reflection in Go".
Note added January 2022: This blog post was written in 2011 and predates
parametric polymorphism (a.k.a. generics) in Go.
Although nothing important in the article has become incorrect as as a result
Although nothing important in the article has become incorrect as a result
of that development in the language,
it has been tweaked in a few places to avoid
confusing someone familiar with modern Go.
@ -305,7 +305,7 @@ is to pass the result of the `Interface` method to the formatted print routine:
fmt.Println(v.Interface())
(Since the this article was first written, a change was made to the `fmt`
(Since this article was first written, a change was made to the `fmt`
package so that it automatically unpacks a `reflect.Value` like this, so
we could just say
@ -363,7 +363,7 @@ prints
settability of v: false
It is an error to call a `Set` method on an non-settable `Value`. But what is settability?
It is an error to call a `Set` method on a non-settable `Value`. But what is settability?
Settability is a bit like addressability, but stricter.
It's the property that a reflection object can modify the actual storage

Просмотреть файл

@ -189,7 +189,7 @@ On the other hand, a design that uses a single map with a struct key does away w
}
hits := make(map[Key]int)
When an Vietnamese person visits the home page,
When a Vietnamese person visits the home page,
incrementing (and possibly creating) the appropriate counter is a one-liner:
hits[Key{"/", "vn"}]++

Просмотреть файл

@ -103,7 +103,7 @@ character may vary depending on the application. For normalization we will
define it as a sequence of runes that starts with a starter, a rune that does
not modify or combine backwards with any other rune, followed by possibly empty
sequence of non-starters, that is, runes that do (typically accents). The
normalization algorithm processes one character at at time.
normalization algorithm processes one character at a time.
Theoretically, there is no bound to the number of runes that can make up a
Unicode character. In fact, there are no restrictions on the number of

Просмотреть файл

@ -531,7 +531,7 @@ The most important thing
we needed to do
was communicate our vision for Go.
That's difficult,
and we're still working at it..
and we're still working at it.
The initial implementation
was an important way
to communicate that vision,
@ -712,7 +712,7 @@ approach to vendoring.
I define vendoring as
copying source code for external dependencies
into your tree
to make sure that they doesn't disappear
to make sure that they don't disappear
or change underfoot.
Vendoring is not a problem Google suffers,

Просмотреть файл

@ -106,7 +106,7 @@ to compile and link a lot of unrelated code.
On the other hand, it is also easy to go overboard in splitting your code
into small packages,
in which case you will likely becomes bogged down in interface design,
in which case you will likely become bogged down in interface design,
rather than just getting the job done.
Look to the Go standard libraries as a guide.

Просмотреть файл

@ -208,7 +208,7 @@ then the client code becomes
set := stringset.New("c", "a", "b")
fmt.Println(stringset.Sort(set))
Once you've made this change, its easier to see how to improve the new package:
Once you've made this change, it's easier to see how to improve the new package:
package stringset
type Set map[string]bool

Просмотреть файл

@ -59,7 +59,7 @@ Go has been powering Docker, Kubernetes, and the rest of the Go ecosystem
on ARM64 Linux servers,
as well as mobile apps on ARM64 Android and iOS devices.
Since Apples announcement of the Mac transitioning to Apple silicon this summer,
Since Apples announcement of the Mac transitioning to Apple Silicon this summer,
Apple and Google have been working together to ensure that Go and the broader
Go ecosystem work well on them,
both running Go x86 binaries under Rosetta 2 and running native Go ARM64 binaries.

Просмотреть файл

@ -607,7 +607,7 @@ The final version runs in 2.29 seconds and uses 351 MB of memory:
That's 11 times faster than the program we started with.
Even if we disable reuse of the generated loop graph, so that the only cached memory
is the loop finding bookeeping, the program still runs 6.7x faster than the original
is the loop finding bookkeeping, the program still runs 6.7x faster than the original
and uses 1.5x less memory.
$ ./xtime ./havlak6 -reuseloopgraph=false

Просмотреть файл

@ -15,7 +15,7 @@ However, for every Gopher I know there are dozens I know nothing about.
In order to address this imbalance I've prepared a survey for Go users everywhere.
The survey is short. It asks about you, your involvement with Go,
and and your interest in Go-related events.
and your interest in Go-related events.
Among other things, this data will help myself and the rest of the Go team
plan future Go events and schedule conference appearances.

Просмотреть файл

@ -122,7 +122,7 @@ In fact, these were the only questions in the survey for which more than half of
did not mark “somewhat agree”, “agree”, or “strongly agree” (many were neutral or did not answer).
We hope that the survey and this blog post convey to those of you
who are arent comfortable reaching out that the Go project leadership is listening.
who arent comfortable reaching out that the Go project leadership is listening.
Throughout 2017 we will be exploring new ways to engage with users to better understand their needs.
{{raw (file "survey2016/project.html")}}

Просмотреть файл

@ -63,7 +63,7 @@ process with the addition of
[Experience Reports](/wiki/ExperienceReports) which is
enabling the project to gather and obtain feedback critical to making these
significant changes. We also made
[sigificant changes](/doc/go1.10#build) under the hood in
[significant changes](/doc/go1.10#build) under the hood in
how Go obtains, and builds packages. This is foundational work essential to
addressing our dependency management needs.
@ -89,7 +89,7 @@ allowed.
Continuing its explosive growth, VSCode is now the most popular editor among
Gophers. IntelliJ/GoLand also saw significant increase in usage. These largely
came at the expense of Atom and Submlime Text which saw relative usage drops.
came at the expense of Atom and Sublime Text which saw relative usage drops.
This question had a 6% higher response rate from last year.
Survey respondents demonstrated significantly higher satisfaction with Go
@ -107,7 +107,7 @@ increase over 2016. For Non-Go applications, AWS Lambda saw the largest increase
We asked how strongly people agreed or disagreed with various statements about
Go. All questions are repeated from last year with the addition of one new
question which we introduced to add further clarifaction around how users are
question which we introduced to add further clarification around how users are
able to both find and **use** Go libraries.
All responses either indicated a small improvement or are comparable to 2016.

Просмотреть файл

@ -60,7 +60,7 @@ We also see an increase in the number of respondents who program in Go outside
of work (64% → 70%).
For the first time, the number of survey respondents who write in Go as
part of their daily routine reached 50% (up from 44% in 2016).
These findings suggests companies are continuing to embrace Go for professional
These findings suggest companies are continuing to embrace Go for professional
software development at a consistent pace,
and that Go's general popularity with developers remains strong.

Просмотреть файл

@ -424,7 +424,7 @@ so they have _very_ long tails;
categories totalling less than 3% of the total responses have been grouped
into the "Other" category for each chart.
A single response may mention multiple topics,
thus charts do not not sum to 100%.
thus charts do not sum to 100%.
Among the 25% of respondents who said Go lacks language features they need,
79% pointed to generics as a critical missing feature.

Просмотреть файл

@ -177,7 +177,7 @@ Its unsurprising 91% of respondents who came to the survey from the VS Code p
### Different resources
The randomly selected sample was less likely to rate social channels like the Go Blog as among their top resources for answering Go-related questions, so they may have been less likely to see the survey advertised on those channels.
<img src="survey2021/resources_s.svg" alt="rouped bar chart showing the top resources respondents use when writing in Go" width="700"/>
<img src="survey2021/resources_s.svg" alt="Grouped bar chart showing the top resources respondents use when writing in Go" width="700"/>
## Conclusion {#conclusion}

Просмотреть файл

@ -60,7 +60,7 @@ some require extremely careful and complex implementations to be secure,
and some are only secure if the client applies certain mitigations or even
has certain hardware.
Beyond the security of the individual components,
different ciphersuites can provide drastically different security properties
different cipher suites can provide drastically different security properties
for the whole connection,
as cipher suites without ECDHE or DHE dont provide forward secrecy—the
property that connections cant be retroactively or passively decrypted
@ -94,7 +94,7 @@ replaced on the fly.
Modern cryptography is significantly different.
Protocols can still break from time to time,
but its rarely an individual abstracted component that fails.
_None of the AEAD-based ciphersuites introduced starting with TLS 1.2 in
_None of the AEAD-based cipher suites introduced starting with TLS 1.2 in
2008 have been broken._ These days cryptographic agility is a liability:
it introduces complexity that can lead to weaknesses or downgrades,
and it is only necessary for performance and compliance reasons.

Просмотреть файл

@ -513,7 +513,7 @@ 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
an indispensible part of the Go experience. Here the best solution was
an indispensable part of the Go experience. Here the best solution was
a runtime and tooling change, not a language change.
There will be language changes as well, of course, but not all

Просмотреть файл

@ -32,7 +32,7 @@ stream a post containing a snapshot of the turkey.
The snapshot is a single image that matches the turkey the user created.
With 13 alternatives for each of 8 parts of the turkey (heads,
pairs of legs, distinct feathers, etc.) there are more than than 800 million
pairs of legs, distinct feathers, etc.) there are more than 800 million
possible snapshot images that could be generated.
To pre-compute them all is clearly infeasible.
Instead, we must generate the snapshots on the fly.

Просмотреть файл

@ -79,7 +79,7 @@ That makes it a good candidate for using type parameters.
The alternative to type parameters for this kind of function is
typically to use reflection, but that is a more awkward programming
model, is not staticaly typechecked at build time, and is often slower
model, is not statically typechecked at build time, and is often slower
at run time.
### General purpose data structures
@ -347,5 +347,5 @@ the only difference between the copies is that the code uses different
types, consider whether you can use a type parameter.
Another way to say this is that you should avoid type parameters until
you notice that you are about the write the exact same code multiple
you notice that you are about to write the exact same code multiple
times.

Просмотреть файл

@ -74,7 +74,7 @@ func TestWikiServer(t *testing.T) {
// Build the server binary from the patched sources.
// The 'go' command requires that they all be in the same directory.
// final_test.go provides the implemtation for our serve function.
// final_test.go provides the implementation for our serve function.
must(copyFile(filepath.Join(dir, "final_srv.go"), "final_test.go"))
cmd := exec.Command("go", "build",
"-o", filepath.Join(dir, "final.exe"),

Просмотреть файл

@ -1237,7 +1237,7 @@ The document <a href="effective_go.html">Effective Go</a>
contains some advice on these topics.
More directly, the program <code>gofmt</code> is a pretty-printer
whose purpose is to enforce layout rules; it replaces the usual
compendium of do's and don'ts that allows interpretation.
compendium of dos and don'ts that allows interpretation.
All the Go code in the repository, and the vast majority in the
open source world, has been run through <code>gofmt</code>.
</p>
@ -2044,7 +2044,7 @@ For example, consider a statement like
</pre>
Without type information, it is impossible to decide whether the right
hand side of the assigment is a pair of expressions (<code>w &lt; x</code>
hand side of the assignment is a pair of expressions (<code>w &lt; x</code>
and <code>y &gt; z</code>), or whether it is a generic function
instantiation and call that returns two result values
(<code>(w&lt;x, y&gt;)(z)</code>).

Просмотреть файл

@ -12,7 +12,7 @@ For each worker the coordinator creates a goroutine which spawns the worker proc
The main coordinator loop picks inputs from the corpus, sending them to the shared worker channel. Whichever worker picks up that input from the channel will send a fuzzing request to the corresponding worker process. This process sits in a loop, mutating the input and executing the fuzz target until an execution either causes an increase in the coverage counters, causes a panic or crash, or passes a predetermined deadline.
If the worker process executes a mutated input which causes an increase in coverage counters or a recoverable panic, it signals this to the coordinator which is then able to reconstruct the mutated input. The coordinator will attempt to [minimize the input](#input-minimization), then either add it to the corpus for further fuzzing, in the case of finding increased coverage, or write it to the testdata directory, in the case of an input which causes a error or panic.
If the worker process executes a mutated input which causes an increase in coverage counters or a recoverable panic, it signals this to the coordinator which is then able to reconstruct the mutated input. The coordinator will attempt to [minimize the input](#input-minimization), then either add it to the corpus for further fuzzing, in the case of finding increased coverage, or write it to the testdata directory, in the case of an input which causes an error or panic.
If a non-recoverable error occurs while fuzzing which causes the worker process to shut down (e.g. infinite loop, os.Exit, memory exhaustion, etc), minimization will not be attempted, and the failing input will be written to the testdata directory and reported.
@ -20,7 +20,7 @@ If a non-recoverable error occurs while fuzzing which causes the worker process
### Cross-process communication
When spawning the child worker processes, the coordinator sets up two two methods of communication: a pipe, which is used to pass JSON-based RPC messages, and a shared memory region, which is used to pass inputs and RNG state. Each worker process has its own pipe and shared memory region.
When spawning the child worker processes, the coordinator sets up two methods of communication: a pipe, which is used to pass JSON-based RPC messages, and a shared memory region, which is used to pass inputs and RNG state. Each worker process has its own pipe and shared memory region.
The RPC pipe is used by the coordinator to control the worker process, sending it either fuzzing or minimization instructions, and by the worker to relay results of its operations to the coordinator (i.e. whether the input expanded coverage, caused a crash, was successfully minimized, etc).
@ -34,11 +34,11 @@ Similarly, the coordinator does not implement any type of corpus minimization (n
## Coverage guidance
The fuzzer uses [libFuzzer compatible](https://clang.llvm.org/docs/SanitizerCoverage.html#inline-8bit-counters) inline 8 bit coverage counters. These counters are inserted during compliation at each code edge, and are incremented on entry. Counters are not protected against overflow, so that they don't become saturated.
The fuzzer uses [libFuzzer compatible](https://clang.llvm.org/docs/SanitizerCoverage.html#inline-8bit-counters) inline 8 bit coverage counters. These counters are inserted during compilation at each code edge, and are incremented on entry. Counters are not protected against overflow, so that they don't become saturated.
Similarly to AFL and libFuzzer, when tracking coverage, the counters are quantized to the nearest power of two. This allows the fuzzer to differentiate between insignificant and significant changes in execution flow. In order to track these changes, the fuzzer holds a slice of bytes which map to the inline counters, the bits of which indicate if there is at least one input in the corpus which increments the related counter at least 2^bit-position times. These bytes can become saturated, if there are inputs which cause counters to hit each quantized value, at which point the related counter fails to provide further useful coverage information.
As coverage counters are added to every edge during compilation, code not being fuzzed is also instrumented, which can cause the worker to detect coverage expansion that is unrelated to the target being executed (for instance if some new code path is triggered in a goroutine unrelated to the fuzz target). The worker attempts to reduce this in two ways: firstly it resets all counters immediately before executing the fuzz target and then snapshops the counters immediately after the target returns, and secondly by explicitly ignoring a set of packages which are likely to be "noisy"
As coverage counters are added to every edge during compilation, code not being fuzzed is also instrumented, which can cause the worker to detect coverage expansion that is unrelated to the target being executed (for instance if some new code path is triggered in a goroutine unrelated to the fuzz target). The worker attempts to reduce this in two ways: firstly it resets all counters immediately before executing the fuzz target and then snapshots the counters immediately after the target returns, and secondly by explicitly ignoring a set of packages which are likely to be "noisy"
A number of packages explicitly do not have counters inserted, since they are likely to introduce counter noise that is unrelated to the target being executed. These packages are:
@ -71,7 +71,7 @@ The mutators attempt to bias towards producing smaller inputs, rather than large
There are numerous mutators for `[]byte` and `string` types, and a smaller number of mutators for all the `int`, `uint`, and `float` types.
There are currently no execution driven mutation strategies implemented (such as input-to-comparisson correspondence), nor dictionary based mutators.
There are currently no execution driven mutation strategies implemented (such as input-to-comparison correspondence), nor dictionary based mutators.
## Input minimization

Просмотреть файл

@ -118,7 +118,7 @@ explicitly.
By default, the go tool creates its temporary files and directories
in the system temporary directory (for example, <code>$TMPDIR</code> on Unix).
If the new environment variable <code>$GOTMPDIR</code> is set,
the go tool will creates its temporary files and directories in that directory instead.
the go tool will create its temporary files and directories in that directory instead.
</p>
<h3 id="build">Build &amp; Install</h3>

Просмотреть файл

@ -694,7 +694,7 @@ godoc
The scanner has been updated to recognize the new Go number literals, specifically
binary literals with <code>0b</code>/<code>0B</code> prefix, octal literals with <code>0o</code>/<code>0O</code> prefix,
and floating-point numbers with hexadecimal mantissa. The imaginary suffix <code>i</code> may now be used with any number
literal, and underscores may used as digit separators for grouping.
literal, and underscores may be used as digit separators for grouping.
See the <a href="#language">Changes to the language</a> for details.
</p>

Просмотреть файл

@ -724,7 +724,7 @@ func Foo() bool {
<p><!-- CL 274234 -->
<a href="/pkg/crypto/x509/#ParseCertificate"><code>ParseCertificate</code></a>
has been rewritten, and now consumes ~70% fewer resources. The observable
behavior when processng WebPKI certificates has not otherwise changed,
behavior when processing WebPKI certificates has not otherwise changed,
except for error messages.
</p>

Просмотреть файл

@ -212,7 +212,7 @@ makes it easier to construct custom binaries for local sites and different deplo
<p>
<em>Updating</em>:
Since godoc and vet are not part of the library,
no client Go code depends on the their source and no updating is required.
no client Go code depends on their source and no updating is required.
</p>
<p>
@ -676,7 +676,7 @@ methods, which implement the obvious rearrangement.
<li>
The <a href="/pkg/crypto/cipher/"><code>crypto/cipher</code></a> package
adds the a new GCM mode (Galois Counter Mode), which is almost always
adds the new GCM mode (Galois Counter Mode), which is almost always
used with AES encryption.
</li>

Просмотреть файл

@ -766,7 +766,7 @@ adds new fields <code>BinaryOnly</code>, <code>CgoFFLAGS</code>, and <code>FFile
<dd>
<p>
To support the corresponding change in <code>go</code> <code>test</code> described above,
<a href="/pkg/go/doc/#Example"><code>Example</code></a> struct adds a Unordered field
<a href="/pkg/go/doc/#Example"><code>Example</code></a> struct adds an Unordered field
indicating whether the example may generate its output lines in any order.
</p>
</dd>

Просмотреть файл

@ -107,7 +107,7 @@ msiexec /x go{{version}}.windows-{{cpu-arch}}.msi /q
<p>
<strong>Note:</strong> Using this uninstall process for Windows will automatically remove windows environment variables created by the original installation.
<strong>Note:</strong> Using this uninstall process for Windows will automatically remove Windows environment variables created by the original installation.
</p>
</li>

Просмотреть файл

@ -6,7 +6,7 @@ import (
// LastIndex returns the index of the last instance of x in list, or
// -1 if x is not present. The loop condition has a fault that
// causes somes tests to fail. Change it to i >= 0 to see them pass.
// causes some tests to fail. Change it to i >= 0 to see them pass.
func LastIndex(list []int, x int) int {
for i := len(list) - 1; i > 0; i-- {
if list[i] == x {

Просмотреть файл

@ -653,7 +653,7 @@ relational database.
Suggested next topics:
* Take a look at the data acccess guide, which includes more information
* Take a look at the data access guide, which includes more information
about the subjects only touched on here.
* If you're new to Go, you'll find useful best practices described in

Просмотреть файл

@ -324,7 +324,7 @@ code to handle a `POST` request to add an item.
## Write a handler to add a new item {#add_item}
When the client makes a `POST` request at `/albums`, you want to add the album
described in the request body to the existing albums data.
described in the request body to the existing albums' data.
To do this, you'll write the following:

Просмотреть файл

@ -179,7 +179,7 @@ all:
local_time: "2021-09-01T18:00:00+10:00"
localizedcountry: Australia
localizedlocation: Canberra, Australia
name: Canberra Gophers Sepember 2021
name: Canberra Gophers September 2021
photourl: ""
state: ""
thumbnailurl: ""

Просмотреть файл

@ -32,7 +32,7 @@ Get live support and talk with other gophers on the Go Discord.
</p>
<h3 id="slack"><a href="https://blog.gopheracademy.com/gophers-slack-community/">Gopher Slack</a></h3>
<p>Get live support from other users in the Go slack channel.</p>
<p>Get live support from other users in the Go Slack channel.</p>
<h3 id="irc"><a href="ircs:irc.libera.chat/go-nuts">Go IRC Channel</a></h3>
<p>Get live support at <code>#go-nuts</code> on <code>irc.libera.chat</code>,

Просмотреть файл

@ -110,7 +110,7 @@ compatible with previous versions.
build metadata is preserved in versions specified in `go.mod` files. The
suffix `+incompatible` denotes a version released before migrating to modules
version major version 2 or later (see [Compatibility with non-module
repositories](#non-module-compat).
repositories](#non-module-compat)).
A version is considered unstable if its major version is 0 or it has a
pre-release suffix. Unstable versions are not subject to compatibility
@ -655,7 +655,7 @@ command.
Since Go 1.16, if a version referenced by a `require` directive in any `go.mod`
file is excluded by an `exclude` directive in the main module's `go.mod` file,
the requirement is ignored. This may be cause commands like [`go get`](#go-get)
the requirement is ignored. This may cause commands like [`go get`](#go-get)
and [`go mod tidy`](#go-mod-tidy) to add new requirements on higher versions
to `go.mod`, with an `// indirect` comment if appropriate.
@ -947,7 +947,7 @@ Consider the example below, where C 1.4 has been replaced with R. R depends on D
1.3 instead of D 1.2, so MVS returns a build list containing A 1.2, B 1.2, C 1.4
(replaced with R), and D 1.3.
![Module version graph with a replacement](/doc/mvs/replace.svg "MVS replacment")
![Module version graph with a replacement](/doc/mvs/replace.svg "MVS replacement")
### Exclusion {#mvs-exclude}
@ -1760,7 +1760,7 @@ The `Module` struct has a `String` method that formats this line of output, so
that the default format is equivalent to {{raw "`-f '{{.String}}'`"}}.
Note that when a module has been replaced, its `Replace` field describes the
replacement module module, and its `Dir` field is set to the replacement
replacement module, and its `Dir` field is set to the replacement
module's source code, if present. (That is, if `Replace` is non-nil, then `Dir`
is set to `Replace.Dir`, with no access to the replaced source code.)
@ -2392,7 +2392,7 @@ A version query may be one of the following:
latest version starting with `v2`, not the branch named `v2`.
* The string `latest`, which selects the highest available release version. If
there are no release versions, `latest` selects the highest pre-release
version. If there no tagged versions, `latest` selects a pseudo-version for
version. If there are no tagged versions, `latest` selects a pseudo-version for
the commit at the tip of the repository's default branch.
* The string `upgrade`, which is like `latest` except that if the module is
currently required at a higher version than the version `latest` would select
@ -3562,7 +3562,7 @@ example:
GOPROXY=https://jrgopher:hunter2@proxy.corp.example.com
```
Use caution when taking this approach: environment variables may be appear
Use caution when taking this approach: environment variables may appear
in shell history and in logs.
### Passing credentials to private repositories {#private-module-repo-auth}
@ -3753,7 +3753,7 @@ conflicts on case-insensitive file systems.
<td>
Directory containing extracted contents of a module <code>.zip</code>
file. This serves as a module root directory for a downloaded module. It
won't contain contain a <code>go.mod</code> file if the original module
won't contain a <code>go.mod</code> file if the original module
didn't have one.
</td>
</tr>
@ -4463,7 +4463,7 @@ distributed together.
**module graph:** The directed graph of module requirements, rooted at the [main
module](#glos-main-module). Each vertex in the graph is a module; each edge is a
version from a `require` statement in a `go.mod` file (subject to `replace` and
`exclude` statements in the main module's `go.mod` file.
`exclude` statements in the main module's `go.mod` file).
<a id="glos-module-graph-pruning"></a>
**module graph pruning:** A change in Go 1.17 that reduces the size of the

Просмотреть файл

@ -29,7 +29,7 @@ feature brings several benefits.
vulncheck is more accurate than standard package-level vulnerability detection:
just because a vulnerable _symbol_ (function or method) is imported, this does
does not mean the symbol is actually used. Consider the following illustrative
not mean the symbol is actually used. Consider the following illustrative
code.
{{raw `
@ -284,7 +284,7 @@ and volume of used computational resources with the
VTA is an over-approximate call graph algorithm. VTA does not miss a call stack
realizable in practice (see Limitations section for exceptions to this), but it
might sometimes report a call stack leading to a vulnerability that cannot be
exercised in practice. Our experiments suggests this does not happen too often.
exercised in practice. Our experiments suggest this does not happen too often.
Consider again the program from the previous section. Existing algorithms, such
as [CHA](https://pkg.go.dev/golang.org/x/tools/go/callgraph/cha) or

Просмотреть файл

@ -13,7 +13,7 @@ _This project is a work in progress._
<div class="image">
<center>
<img src="architecture.svg" alt="Go Vulneraility Management Architecture"></img>
<img src="architecture.svg" alt="Go Vulnerability Management Architecture"></img>
</center>
</div>

Просмотреть файл

@ -62,7 +62,7 @@ Viper [supports nested structures](https://scene-si.org/2017/04/20/managing-conf
url: https://xfinity.com/
logoSrc: comcast.svg
logoSrcDark: comcast.svg
desc: Comcast uses Go for a CLI client used to publish and subscribe to its high-traffic sites. The company also supports an open source client library which is written in Go - designed for working with Apache Pulsar.
desc: Comcast uses Go for a CLI client used to publish and subscribe to its high-traffic sites. The company also supports an open source client library which is written in Go - designed for working with Apache Pulsar.
ctas:
- text: Client library for Apache Pulsar
url: https://github.com/Comcast/pulsar-client-go
@ -80,7 +80,7 @@ Viper [supports nested structures](https://scene-si.org/2017/04/20/managing-conf
url: http://gohugo.io/
logoSrc: hugo.svg
logoSrcDark: hugo.svg
desc: Hugo is one of the most popular Go CLI applications powering thousands of sites, including this one. One reason for its popularity is its ease of install thanks to Go. Hugo author Bjørn Erik Pedersen writes “The single binary takes most of the pain out of installation and upgrades.”
desc: Hugo is one of the most popular Go CLI applications powering thousands of sites, including this one. One reason for its popularity is its ease of install thanks to Go. Hugo author Bjørn Erik Pedersen writes “The single binary takes most of the pain out of installation and upgrades.”
ctas:
- text: Hugo Website
url: https://gohugo.io/

Просмотреть файл

@ -2,7 +2,7 @@
linkTitle: How Microsoft Embraces Go
description:
Learn about how Microsoft has helped support Go and how it uses Go to power
pieces of it's cloud infrastructure.
pieces of its cloud infrastructure.
company: Microsoft
series: Case Studies
logoSrc: microsoft_light.svg

Просмотреть файл

@ -1,6 +1,6 @@
---
linkTitle: "Riot Games - Leveraging Golang for Game Development and Operations"
description: "Learn how Riot uses Go to develop, deploy, and operate backend microserves at scale–globally. They share thier experience across use cases, with specific examples, and speak to the value of the gopher community."
description: "Learn how Riot uses Go to develop, deploy, and operate backend microservices at scale–globally. They share their experience across use cases, with specific examples, and speak to the value of the gopher community."
company: Riot Games
logoSrc: riot_light.svg
logoSrcDark: riot_dark.svg

Просмотреть файл

@ -261,7 +261,7 @@ func main() {
<h2>Threads and locks are concurrency primitives; CSP is a concurrency model:</h2>
<ul>
<li>Analogy: &quot;Go To Statement Considered Harmful&quot; (Dijsktra, 1968)</li>
<li>Analogy: &quot;Go To Statement Considered Harmful&quot; (Dijkstra, 1968)</li>
<li><code>goto</code> is a control flow primitive; structured programming (<code>if</code> statements, <code>for</code> loops, function calls) is a control flow model</li>
</ul>

Просмотреть файл

@ -31,7 +31,7 @@ Go is a new, general-purpose programming language.
- More than 250 contributors join the project
- Version 1.0 release in March 2012
# Go was originally built by a team at Google, led by Robert Griesemer, Rob Pike, and Ken Thompson. In November 2010, Go was launched publically as an open source project. Since then, a team at Google and more than 250 contributors from the open source community continued to improve the Go language, libraries, and tools.
# Go was originally built by a team at Google, led by Robert Griesemer, Rob Pike, and Ken Thompson. In November 2010, Go was launched publicly as an open source project. Since then, a team at Google and more than 250 contributors from the open source community continued to improve the Go language, libraries, and tools.
# In March 2012, we announced Go 1, a version of the language and libraries that will be supported for years to come.

Просмотреть файл

@ -443,7 +443,7 @@ Some history: swtch.com/~rsc/thread/
A previous talk (video): tinyurl.com/newsqueak1
Parellelism is not concurrency (Harper): tinyurl.com/pincharper
Parallelism is not concurrency (Harper): tinyurl.com/pincharper
A concurrent window system (Pike): tinyurl.com/pikecws

Просмотреть файл

@ -1,3 +1,4 @@
//go:build ignore && OMIT
// +build ignore,OMIT
// dedupermain runs the Subscribe example with several duplicate
@ -99,7 +100,7 @@ func (s *sub) loopFetchOnly() {
var next time.Time // initially January 1, year 0
var err error
for {
var fetchDelay time.Duration // initally 0 (no delay)
var fetchDelay time.Duration // initially 0 (no delay)
if now := time.Now(); next.After(now) {
fetchDelay = next.Sub(now)
}
@ -238,7 +239,7 @@ func (s *sub) dedupeLoop() {
}
}
// loop periodically fecthes Items, sends them on s.updates, and exits
// loop periodically fetches Items, sends them on s.updates, and exits
// when Close is called. It extends dedupeLoop with logic to run
// Fetch asynchronously.
func (s *sub) loop() {

Просмотреть файл

@ -1,3 +1,4 @@
//go:build ignore && OMIT
// +build ignore,OMIT
// fakemain runs the Subscribe example with a fake RSS fetcher.
@ -98,7 +99,7 @@ func (s *sub) loopFetchOnly() {
var next time.Time // initially January 1, year 0
var err error
for {
var fetchDelay time.Duration // initally 0 (no delay)
var fetchDelay time.Duration // initially 0 (no delay)
if now := time.Now(); next.After(now) {
fetchDelay = next.Sub(now)
}
@ -237,7 +238,7 @@ func (s *sub) dedupeLoop() {
}
}
// loop periodically fecthes Items, sends them on s.updates, and exits
// loop periodically fetches Items, sends them on s.updates, and exits
// when Close is called. It extends dedupeLoop with logic to run
// Fetch asynchronously.
func (s *sub) loop() {

Просмотреть файл

@ -1,5 +1,6 @@
// naivemain runs the Subscribe example with the naive Subscribe
// implementation and a fake RSS fetcher.
//go:build ignore && OMIT
// +build ignore,OMIT
package main
@ -99,7 +100,7 @@ func (s *sub) loopFetchOnly() {
var next time.Time // initially January 1, year 0
var err error
for {
var fetchDelay time.Duration // initally 0 (no delay)
var fetchDelay time.Duration // initially 0 (no delay)
if now := time.Now(); next.After(now) {
fetchDelay = next.Sub(now)
}
@ -238,7 +239,7 @@ func (s *sub) dedupeLoop() {
}
}
// loop periodically fecthes Items, sends them on s.updates, and exits
// loop periodically fetches Items, sends them on s.updates, and exits
// when Close is called. It extends dedupeLoop with logic to run
// Fetch asynchronously.
func (s *sub) loop() {

Просмотреть файл

@ -1,3 +1,4 @@
//go:build ignore && OMIT
// +build ignore,OMIT
// realmain runs the Subscribe example with a real RSS fetcher.
@ -100,7 +101,7 @@ func (s *sub) loopFetchOnly() {
var next time.Time // initially January 1, year 0
var err error
for {
var fetchDelay time.Duration // initally 0 (no delay)
var fetchDelay time.Duration // initially 0 (no delay)
if now := time.Now(); next.After(now) {
fetchDelay = next.Sub(now)
}
@ -239,7 +240,7 @@ func (s *sub) dedupeLoop() {
}
}
// loop periodically fecthes Items, sends them on s.updates, and exits
// loop periodically fetches Items, sends them on s.updates, and exits
// when Close is called. It extends dedupeLoop with logic to run
// Fetch asynchronously.
func (s *sub) loop() {

Просмотреть файл

@ -631,7 +631,7 @@ And there's lots to learn!
- [[http://go.dev/talks/2012/concurrency.slide#1][Go Concurrency Patterns]], by Rob Pike
- [[http://go.dev/talks/2013/advconc.slide#1][Advanced Concurrency Patterns]], by Sameer Ajmani
- [[http://go.dev/talks/2012/waza.slide#1][Concurrency is not Parellelism]], by Rob Pike
- [[http://go.dev/talks/2012/waza.slide#1][Concurrency is not Parallelism]], by Rob Pike
.image go4java/img/busy.jpg

Просмотреть файл

@ -55,7 +55,7 @@ _"_Want_to_understand_something_in_google_servers?_Read_the_Go_implementation!_"
[[https://golang.org/cmd/gofmt/][go fmt]] - format Go programs.
[[https://godoc.org/golang.org/x/tools/cmd/vet][go vet]] - report suspicious code
[[https://github.com/golang/lint][golint]] - report coding style errors.
[[http://blog.golang.org/godoc-documenting-go-code][godoc]] - browse documenation
[[http://blog.golang.org/godoc-documenting-go-code][godoc]] - browse documentation
# Go code is easy to read for tools too.
@ -132,7 +132,7 @@ If client doesn't need to distinguish errors, e.g. ok with `err` `!=` `nil` chec
If client wants to distinguish several errors by error code.
var (
ErrInternal = errors.New("foo: inetrnal error")
ErrInternal = errors.New("foo: internal error")
ErrBadRequest = errors.New("foo: bad request")
)

Просмотреть файл

@ -1,3 +1,4 @@
//go:build ignore && OMIT
// +build ignore,OMIT
package sample // OMIT
@ -10,7 +11,7 @@ import ( // OMIT
var (
ErrDurationUnterminated = errors.new("duration: unterminated")
ErrNoDuration = errors.New("duration: not found")
ErrNoIteration = errors.New("duration: not interation")
ErrNoIteration = errors.New("duration: no iteration")
)
func (it Iterator) DurationAt() (time.Duration, error) { // HL

Просмотреть файл

@ -285,7 +285,7 @@ Works fine for Go, except:
$ go run -race lots_of_goroutines.go
race: limit on 8192 simultaneously alive goroutines is exceeded, dying
Research question: race dectector that efficiently supports hundreds of thousands of goroutines?
Research question: race detector that efficiently supports hundreds of thousands of goroutines?
* Deadlock detection
@ -386,7 +386,7 @@ Gosmith is a tool that generates random Go programs that statically and dynamica
Turned out to be much simpler than C: no undefined behavior all around!
- no unitialized variables
- no uninitialized variables
- no concurrent mutations between sequence points (x[i++] = --i)
- no UB during signed overflow
- total 191 kinds of undefined behavior and 52 kinds of unspecified behavior in C

Просмотреть файл

@ -81,7 +81,7 @@ The `go` tool can report test coverage statistics.
coverage: 96.4% of statements
ok strings 0.692s
The `go` tool can generate coverage profiles that may be intepreted by the `cover` tool.
The `go` tool can generate coverage profiles that may be interpreted by the `cover` tool.
$ go test -coverprofile=cover.out
$ go tool cover -func=cover.out

Просмотреть файл

@ -246,7 +246,7 @@ But no pointer arithmetics:
There's `new` but there's no `delete`.
Memory is garbaged collected after it's no longer accessible.
Memory is garbage collected after it's no longer accessible.
* Memory allocation
@ -683,7 +683,7 @@ And there's lots to learn!
- [[http://go.dev/talks/2012/concurrency.slide#1][Go Concurrency Patterns]], by Rob Pike
- [[http://go.dev/talks/2013/advconc.slide#1][Advanced Concurrency Patterns]], by Sameer Ajmani
- [[http://go.dev/talks/2012/waza.slide#1][Concurrency is not Parellelism]], by Rob Pike
- [[http://go.dev/talks/2012/waza.slide#1][Concurrency is not Parallelism]], by Rob Pike
.image go4cpp/busy.jpg

Просмотреть файл

@ -521,7 +521,7 @@ gri@golang.org
* 编程文化的演变
## `gofmt` is significant selling point for Go
- `gomft` 是 Go 语言的一个重要的卖点
- `gofmt` 是 Go 语言的一个重要的卖点
## Insight is spreading that uniform "good enough" formatting is hugely beneficial.
- 大家渐渐达成共识:一致的“足够好“的格式很有好处

Просмотреть файл

@ -557,7 +557,7 @@ But on design, just this:
"Before undertaking to write something new for the Go project, send mail to the mailing list to discuss what you plan to do."
Does this decribe the project's approach to design? Only superficially.
Does this describe the project's approach to design? Only superficially.
Successful proposals include design docs
that discuss rationale, tradeoffs, and implementation.

Просмотреть файл

@ -1,3 +1,4 @@
//go:build ignore && OMIT
// +build ignore,OMIT
package main
@ -49,7 +50,7 @@ func (ss *ShirtSize) UnmarshalJSON(data []byte) error {
return fmt.Errorf("shirt-size should be a string, got %s", data)
}
// The rest is equivalen to ParseShirtSize.
// The rest is equivalent to ParseShirtSize.
got, ok := map[string]ShirtSize{"XS": XS, "S": S, "M": M, "L": L, "XL": XL}[s]
if !ok {
return fmt.Errorf("invalid ShirtSize %q", s)

Просмотреть файл

@ -54,7 +54,7 @@ Given such a rewriter, which is going to be our prototype of a real implementati
[11]
So lets design our rewriter. Since we want to rewrite index expressions into methods, we are going to allow two special method names, made up of a sequence of index and assignment operators. Im calling them indexed getters and indexed setters.
I have also added the binary operator + to this list. We dont need it for our proposal, but its easier to explain the rewriting process using + down the road, which why its here.
We also going to allow more than one index in index expressions.
We are also going to allow more than one index in index expressions.
This doesnt make sense for the basic indexable data structures (arrays, slices, maps) we have in Go, of course. But it does make sense for our extended indexing operations.
And finally, we need to give some new meaning to index expressions. The idea is simple: Whenever we see an index expression where the indexed expression, say x, has a respective getter or setter, then the index expression is interpreted as the respective method call.
This last part is crucial, its the core of the rewriter. Were going to look at it in more detail.
@ -115,7 +115,7 @@ For instance, using our rewriter, we can now define a Matrix type, effectively r
Given this Matrix type, we can implement matrix multiplication. Im showing the core of the multiplication here: On the left, we have the code that we wish to write, and which current Go doesnt understand, and on the right we have the rewritten version which is valid Go code.
[26]
Finally, I want to briefly raise an important point which I havent talked about yet: During the implementation of a prototype, one will invariable encounter the unexpected. In other words, questions will come up that we didnt even know we should be asking.
Finally, I want to briefly raise an important point which I havent talked about yet: During the implementation of a prototype, one will invariably encounter the unexpected. In other words, questions will come up that we didnt even know we should be asking.
Without a prototype, these same questions will come up much later, when its perhaps too late.
[27]

Просмотреть файл

@ -26,7 +26,7 @@ function toggleNotesWindow() {
initNotes();
}
// Create an unique key for the local storage so we don't mix the
// Create a unique key for the local storage so we don't mix the
// destSlide of different presentations. For golang.org/issue/24688.
function destSlideKey() {
var key = '';

Просмотреть файл

@ -53,7 +53,7 @@ controller('EditorCtrl', ['$scope', '$routeParams', '$location', 'toc', 'i18n',
$scope.curPage = page;
} else {
l = (page < 1) ? toc.prevLesson(l) : toc.nextLesson(l);
if (l === '') { // If there's not previous or next
if (l === '') { // If there's no previous or next
$location.path('/tour/list');
return;
}

Просмотреть файл

@ -97,7 +97,7 @@ func Load(fsys fs.FS) (DB, error) {
return vp.res, nil
}
// parser parses $GOROOT/api/go*.txt files and stores them in in its rows field.
// parser parses $GOROOT/api/go*.txt files and stores them in its rows field.
type parser struct {
res DB // initialized lazily
}

Просмотреть файл

@ -207,7 +207,7 @@ func sanitize(src template.HTML) template.HTML {
}
// Since reports the Go version that introduced the API feature
// identified by kind, reeciver, name.
// identified by kind, receiver, name.
func (p *Page) Since(kind, receiver, name string) string {
pkg := p.PDoc.ImportPath
return p.docs.api.Func(pkg, kind, receiver, name)

Просмотреть файл

@ -212,7 +212,7 @@ func srcPkgHandler(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, r.URL.String(), http.StatusMovedPermanently)
}
// validCLID is used to validate cl path suffxies. It supports both the
// validCLID is used to validate cl path suffixes. It supports both the
// bare ID, as well as the patchset syntax (i.e. 1234/2.)
var validCLID = regexp.MustCompile(`^[0-9]+(/[0-9]+)?/?$`)

Просмотреть файл

@ -70,7 +70,7 @@ func initTour(mux *http.ServeMux, transport string) error {
return initScript(mux, socketAddr(), transport)
}
// initLessonss finds all the lessons in the content directory, renders them,
// initLessons finds all the lessons in the content directory, renders them,
// using the given template and saves the content in the lessons map.
func initLessons(tmpl *template.Template) error {
files, err := fs.ReadDir(contentTour, "tour")

Просмотреть файл

@ -64,7 +64,7 @@ func (site *Site) openPage(file string) (*pageFile, error) {
}
// Check md before html to work correctly when x/website is layered atop Go 1.15 goroot during Go 1.15 tests.
// Want to find x/website's debugging_with_gdb.md not Go 1.15's debuging_with_gdb.html.
// Want to find x/website's debugging_with_gdb.md not Go 1.15's debugging_with_gdb.html.
files := []string{file + ".md", file + ".html", path.Join(file, "index.md"), path.Join(file, "index.html")}
var filePath string
var b []byte

Просмотреть файл

@ -58,7 +58,7 @@
// - FileData: the file body, with the key-value metadata stripped
// - URL: this page's URL path (/x/y/z for x/y/z.md, /x/y/ for x/y/index.md)
//
// The key “Content” is added during during the rendering process.
// The key “Content” is added during the rendering process.
// See “Page Rendering” for details.
//
// # Page Rendering
@ -129,7 +129,7 @@
// If both start and end are specified, then the display shows a range of lines
// starting at start up to and including end.
// The arguments start and end can take two forms: a number indicates a specific line number,
// and a string is taken to be a regular expresion indicating the earliest matching line
// and a string is taken to be a regular expression indicating the earliest matching line
// in the file (or, for end, the earliest matching line after the start line).
// Any lines ending in “OMIT” are elided from the display.
//

Просмотреть файл

@ -112,8 +112,8 @@
//
// == - the value must be equal to the text
// != - the value must not be equal to the text
// ~ - the value must match the text interprted as a regular expression
// !~ - the value must not match the text interprted as a regular expression
// ~ - the value must match the text interpreted as a regular expression
// !~ - the value must not match the text interpreted as a regular expression
// contains - the value must contain the text as a substring
// !contains - the value must not contain the text as a substring
//

Просмотреть файл

@ -4,7 +4,7 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# This code parses mapping.old and finds a correspondance from the old
# This code parses mapping.old and finds a correspondence from the old
# urls (e.g. #42) to the corresponding path (e.g. /concurrency/3).
function findURL {