Skip to content

Commit

Permalink
gotypes: re-make README.md
Browse files Browse the repository at this point in the history
Regenerate README.md from go-types.md. There are minor changes,
mostly removals of line-ending spaces.

Change-Id: I83ba4b385de44e0dd2c61f5f3019d08a24ebad29
Reviewed-on: https://go-review.googlesource.com/c/example/+/494595
TryBot-Result: Gopher Robot <[email protected]>
Run-TryBot: Jonathan Amsterdam <[email protected]>
Reviewed-by: Alan Donovan <[email protected]>
  • Loading branch information
jba committed May 12, 2023
1 parent 1d341ff commit 61060d6
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions gotypes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ This document is maintained by Alan Donovan `[email protected]`.

# Changes in Go 1.18

Go 1.18 introduces generic Go code, and several corresponding new APIs for
`go/types`. This document is not yet up-to-date for these changes, but a guide
to the new changes exists at
Go 1.18 introduces generics, and several corresponding new APIs for `go/types`.
This document is not yet up-to-date for these changes, but a guide to the new
changes exists at
[`x/exp/typeparams/example`](https://github.com/golang/exp/tree/master/typeparams/example).

# Introduction
Expand Down Expand Up @@ -224,7 +224,7 @@ how to locate the imported packages.
Here we use `importer.Default()`, which loads compiler-generated
export data, but we'll explore alternatives in [Imports](#imports).



Fourth, the program calls `Check`.
This creates a `Package` whose path is `"cmd/hello"`, and
Expand Down Expand Up @@ -734,7 +734,7 @@ by calling its `(*Func).Scope` method.


<!--
TODO: explain explicit and implicit blocks
TODO: explain explicit and implicit blocks
TODO: explain Dot imports.
TODO: explain that Func blocks are associated with FuncType (not FuncDecl or FuncLit)
-->
Expand Down Expand Up @@ -830,7 +830,7 @@ does a name lookup at a specific position in that lexical block.



A typical input is shown below.
A typical input is shown below.
The first comment causes a lookup of `"append"` in the file block.
The second comment looks up `"fmt"` in the `main` function's block,
and so on.
Expand Down Expand Up @@ -1185,7 +1185,7 @@ The type checker builds the exact same data structures given this input:

A similar issue applies to the methods of named interface types.


## Tuple Types


Expand Down Expand Up @@ -1419,7 +1419,7 @@ interface `v`, then the type assertion is not legal, as in this example:


// error: io.Writer is not assertible to int
func f(w io.Writer) int { return w.(int) }
func f(w io.Writer) int { return w.(int) }



Expand Down Expand Up @@ -1754,7 +1754,7 @@ all.)


The final two parameters of `LookupFieldOrMethod` are `(pkg
*Package, name string)`.
*Package, name string)`.
Together they specify the name of the field or method to look up.
This brings us to `Id`s.

Expand Down Expand Up @@ -2066,7 +2066,7 @@ Constants are represented using the `Value` interface from the
package constant // go/constant

type Value interface {
Kind() Kind
Kind() Kind
}

type Kind int // one of Unknown, Bool, String, Int, Float, Complex
Expand Down

0 comments on commit 61060d6

Please sign in to comment.