Skip to content

Commit cf37a9a

Browse files
committed
Merge remote-tracking branch 'origin/master' into feature/sync-atomic-and-or-x86-64
2 parents 51ec584 + 0262ea1 commit cf37a9a

File tree

1,190 files changed

+18242
-11734
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,190 files changed

+18242
-11734
lines changed

api/next/61870.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pkg io, method (*SectionReader) Outer() (ReaderAt, int64, int64) #61870

doc/go_spec.html

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--{
22
"Title": "The Go Programming Language Specification",
3-
"Subtitle": "Version of Sep 13, 2023",
3+
"Subtitle": "Version of Oct 16, 2023",
44
"Path": "/ref/spec"
55
}-->
66

@@ -4826,12 +4826,13 @@ <h4 id="Operator_precedence">Operator precedence</h4>
48264826
</p>
48274827

48284828
<pre>
4829-
+x
4830-
23 + 3*x[i]
4831-
x &lt;= f()
4832-
^a &gt;&gt; b
4833-
f() || g()
4834-
x == y+1 &amp;&amp; &lt;-chanInt &gt; 0
4829+
+x // x
4830+
42 + a - b // (42 + a) - b
4831+
23 + 3*x[i] // 23 + (3 * x[i])
4832+
x &lt;= f() // x &lt;= f()
4833+
^a &gt;&gt; b // (^a) >> b
4834+
f() || g() // f() || g()
4835+
x == y+1 &amp;&amp; &lt;-chanInt &gt; 0 // (x == (y+1)) && ((<-chanInt) > 0)
48354836
</pre>
48364837

48374838

doc/godebug.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ and the [go command documentation](/cmd/go#hdr-Build_and_test_caching).
129129
### Go 1.22
130130

131131
Go 1.22 adds a configurable limit to control the maximum acceptable RSA key size
132-
that can be used in TLS handshakes, controlled by the [`tlsmaxrsasize`setting](/pkg/crypto/tls#Conn.Handshake).
132+
that can be used in TLS handshakes, controlled by the [`tlsmaxrsasize` setting](/pkg/crypto/tls#Conn.Handshake).
133133
The default is tlsmaxrsasize=8192, limiting RSA to 8192-bit keys. To avoid
134134
denial of service attacks, this setting and default was backported to Go
135135
1.19.13, Go 1.20.8, and Go 1.21.1.

misc/ios/detect.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// license that can be found in the LICENSE file.
44

55
//go:build ignore
6-
// +build ignore
76

87
// detect attempts to autodetect the correct
98
// values of the environment variables

src/archive/tar/common.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ const (
634634
c_ISSOCK = 0140000 // Socket
635635
)
636636

637-
// FileInfoHeader creates a partially-populated Header from fi.
637+
// FileInfoHeader creates a partially-populated [Header] from fi.
638638
// If fi describes a symlink, FileInfoHeader records link as the link target.
639639
// If fi describes a directory, a slash is appended to the name.
640640
//

src/archive/tar/format.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import "strings"
3333
// sub-second times | no | yes | no
3434
// sparse files | no | yes | yes
3535
//
36-
// The table's upper portion shows the Header fields, where each format reports
36+
// The table's upper portion shows the [Header] fields, where each format reports
3737
// the maximum number of bytes allowed for each string field and
3838
// the integer type used to store each numeric field
3939
// (where timestamps are stored as the number of seconds since the Unix epoch).

src/archive/tar/reader.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ type fileReader interface {
3535
WriteTo(io.Writer) (int64, error)
3636
}
3737

38-
// NewReader creates a new Reader reading from r.
38+
// NewReader creates a new [Reader] reading from r.
3939
func NewReader(r io.Reader) *Reader {
4040
return &Reader{r: r, curr: &regFileReader{r, 0}}
4141
}
@@ -47,10 +47,10 @@ func NewReader(r io.Reader) *Reader {
4747
//
4848
// If Next encounters a non-local name (as defined by [filepath.IsLocal])
4949
// and the GODEBUG environment variable contains `tarinsecurepath=0`,
50-
// Next returns the header with an ErrInsecurePath error.
50+
// Next returns the header with an [ErrInsecurePath] error.
5151
// A future version of Go may introduce this behavior by default.
5252
// Programs that want to accept non-local names can ignore
53-
// the ErrInsecurePath error and use the returned header.
53+
// the [ErrInsecurePath] error and use the returned header.
5454
func (tr *Reader) Next() (*Header, error) {
5555
if tr.err != nil {
5656
return nil, tr.err
@@ -623,14 +623,14 @@ func readGNUSparseMap0x1(paxHdrs map[string]string) (sparseDatas, error) {
623623

624624
// Read reads from the current file in the tar archive.
625625
// It returns (0, io.EOF) when it reaches the end of that file,
626-
// until Next is called to advance to the next file.
626+
// until [Next] is called to advance to the next file.
627627
//
628628
// If the current file is sparse, then the regions marked as a hole
629629
// are read back as NUL-bytes.
630630
//
631-
// Calling Read on special types like TypeLink, TypeSymlink, TypeChar,
632-
// TypeBlock, TypeDir, and TypeFifo returns (0, io.EOF) regardless of what
633-
// the Header.Size claims.
631+
// Calling Read on special types like [TypeLink], [TypeSymlink], [TypeChar],
632+
// [TypeBlock], [TypeDir], and [TypeFifo] returns (0, [io.EOF]) regardless of what
633+
// the [Header.Size] claims.
634634
func (tr *Reader) Read(b []byte) (int, error) {
635635
if tr.err != nil {
636636
return 0, tr.err

src/archive/tar/writer.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
)
1717

1818
// Writer provides sequential writing of a tar archive.
19-
// Write.WriteHeader begins a new file with the provided Header,
19+
// [Writer.WriteHeader] begins a new file with the provided [Header],
2020
// and then Writer can be treated as an io.Writer to supply that file's data.
2121
type Writer struct {
2222
w io.Writer
@@ -46,7 +46,7 @@ type fileWriter interface {
4646
// Flush finishes writing the current file's block padding.
4747
// The current file must be fully written before Flush can be called.
4848
//
49-
// This is unnecessary as the next call to WriteHeader or Close
49+
// This is unnecessary as the next call to [Writer.WriteHeader] or [Writer.Close]
5050
// will implicitly flush out the file's padding.
5151
func (tw *Writer) Flush() error {
5252
if tw.err != nil {
@@ -464,12 +464,12 @@ func splitUSTARPath(name string) (prefix, suffix string, ok bool) {
464464
}
465465

466466
// Write writes to the current file in the tar archive.
467-
// Write returns the error ErrWriteTooLong if more than
468-
// Header.Size bytes are written after WriteHeader.
467+
// Write returns the error [ErrWriteTooLong] if more than
468+
// Header.Size bytes are written after [Writer.WriteHeader].
469469
//
470-
// Calling Write on special types like TypeLink, TypeSymlink, TypeChar,
471-
// TypeBlock, TypeDir, and TypeFifo returns (0, ErrWriteTooLong) regardless
472-
// of what the Header.Size claims.
470+
// Calling Write on special types like [TypeLink], [TypeSymlink], [TypeChar],
471+
// [TypeBlock], [TypeDir], and [TypeFifo] returns (0, [ErrWriteTooLong]) regardless
472+
// of what the [Header.Size] claims.
473473
func (tw *Writer) Write(b []byte) (int, error) {
474474
if tw.err != nil {
475475
return 0, tw.err
@@ -503,7 +503,7 @@ func (tw *Writer) readFrom(r io.Reader) (int64, error) {
503503
}
504504

505505
// Close closes the tar archive by flushing the padding, and writing the footer.
506-
// If the current file (from a prior call to WriteHeader) is not fully written,
506+
// If the current file (from a prior call to [Writer.WriteHeader]) is not fully written,
507507
// then this returns an error.
508508
func (tw *Writer) Close() error {
509509
if tw.err == ErrWriteAfterClose {

src/archive/zip/reader.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ type Reader struct {
4848
fileList []fileListEntry
4949
}
5050

51-
// A ReadCloser is a Reader that must be closed when no longer needed.
51+
// A ReadCloser is a [Reader] that must be closed when no longer needed.
5252
type ReadCloser struct {
5353
f *os.File
5454
Reader
5555
}
5656

5757
// A File is a single file in a ZIP archive.
58-
// The file information is in the embedded FileHeader.
59-
// The file content can be accessed by calling Open.
58+
// The file information is in the embedded [FileHeader].
59+
// The file content can be accessed by calling [File.Open].
6060
type File struct {
6161
FileHeader
6262
zip *Reader
@@ -93,16 +93,16 @@ func OpenReader(name string) (*ReadCloser, error) {
9393
return r, err
9494
}
9595

96-
// NewReader returns a new Reader reading from r, which is assumed to
96+
// NewReader returns a new [Reader] reading from r, which is assumed to
9797
// have the given size in bytes.
9898
//
9999
// If any file inside the archive uses a non-local name
100100
// (as defined by [filepath.IsLocal]) or a name containing backslashes
101101
// and the GODEBUG environment variable contains `zipinsecurepath=0`,
102-
// NewReader returns the reader with an ErrInsecurePath error.
102+
// NewReader returns the reader with an [ErrInsecurePath] error.
103103
// A future version of Go may introduce this behavior by default.
104104
// Programs that want to accept non-local names can ignore
105-
// the ErrInsecurePath error and use the returned reader.
105+
// the [ErrInsecurePath] error and use the returned reader.
106106
func NewReader(r io.ReaderAt, size int64) (*Reader, error) {
107107
if size < 0 {
108108
return nil, errors.New("zip: size cannot be negative")
@@ -178,7 +178,7 @@ func (r *Reader) init(rdr io.ReaderAt, size int64) error {
178178

179179
// RegisterDecompressor registers or overrides a custom decompressor for a
180180
// specific method ID. If a decompressor for a given method is not found,
181-
// Reader will default to looking up the decompressor at the package level.
181+
// [Reader] will default to looking up the decompressor at the package level.
182182
func (r *Reader) RegisterDecompressor(method uint16, dcomp Decompressor) {
183183
if r.decompressors == nil {
184184
r.decompressors = make(map[uint16]Decompressor)
@@ -202,7 +202,7 @@ func (rc *ReadCloser) Close() error {
202202
// DataOffset returns the offset of the file's possibly-compressed
203203
// data, relative to the beginning of the zip file.
204204
//
205-
// Most callers should instead use Open, which transparently
205+
// Most callers should instead use [File.Open], which transparently
206206
// decompresses data and verifies checksums.
207207
func (f *File) DataOffset() (offset int64, err error) {
208208
bodyOffset, err := f.findBodyOffset()
@@ -212,7 +212,7 @@ func (f *File) DataOffset() (offset int64, err error) {
212212
return f.headerOffset + bodyOffset, nil
213213
}
214214

215-
// Open returns a ReadCloser that provides access to the File's contents.
215+
// Open returns a [ReadCloser] that provides access to the [File]'s contents.
216216
// Multiple files may be read concurrently.
217217
func (f *File) Open() (io.ReadCloser, error) {
218218
bodyOffset, err := f.findBodyOffset()
@@ -255,7 +255,7 @@ func (f *File) Open() (io.ReadCloser, error) {
255255
return rc, nil
256256
}
257257

258-
// OpenRaw returns a Reader that provides access to the File's contents without
258+
// OpenRaw returns a [Reader] that provides access to the [File]'s contents without
259259
// decompression.
260260
func (f *File) OpenRaw() (io.Reader, error) {
261261
bodyOffset, err := f.findBodyOffset()

src/archive/zip/register.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
type Compressor func(w io.Writer) (io.WriteCloser, error)
2020

2121
// A Decompressor returns a new decompressing reader, reading from r.
22-
// The ReadCloser's Close method must be used to release associated resources.
22+
// The [io.ReadCloser]'s Close method must be used to release associated resources.
2323
// The Decompressor itself must be safe to invoke from multiple goroutines
2424
// simultaneously, but each returned reader will be used only by
2525
// one goroutine at a time.
@@ -115,15 +115,15 @@ func init() {
115115
}
116116

117117
// RegisterDecompressor allows custom decompressors for a specified method ID.
118-
// The common methods Store and Deflate are built in.
118+
// The common methods [Store] and [Deflate] are built in.
119119
func RegisterDecompressor(method uint16, dcomp Decompressor) {
120120
if _, dup := decompressors.LoadOrStore(method, dcomp); dup {
121121
panic("decompressor already registered")
122122
}
123123
}
124124

125125
// RegisterCompressor registers custom compressors for a specified method ID.
126-
// The common methods Store and Deflate are built in.
126+
// The common methods [Store] and [Deflate] are built in.
127127
func RegisterCompressor(method uint16, comp Compressor) {
128128
if _, dup := compressors.LoadOrStore(method, comp); dup {
129129
panic("compressor already registered")

src/archive/zip/struct.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -160,12 +160,12 @@ type FileHeader struct {
160160
ExternalAttrs uint32 // Meaning depends on CreatorVersion
161161
}
162162

163-
// FileInfo returns an fs.FileInfo for the FileHeader.
163+
// FileInfo returns an fs.FileInfo for the [FileHeader].
164164
func (h *FileHeader) FileInfo() fs.FileInfo {
165165
return headerFileInfo{h}
166166
}
167167

168-
// headerFileInfo implements fs.FileInfo.
168+
// headerFileInfo implements [fs.FileInfo].
169169
type headerFileInfo struct {
170170
fh *FileHeader
171171
}
@@ -194,7 +194,7 @@ func (fi headerFileInfo) String() string {
194194
return fs.FormatFileInfo(fi)
195195
}
196196

197-
// FileInfoHeader creates a partially-populated FileHeader from an
197+
// FileInfoHeader creates a partially-populated [FileHeader] from an
198198
// fs.FileInfo.
199199
// Because fs.FileInfo's Name method returns only the base name of
200200
// the file it describes, it may be necessary to modify the Name field
@@ -273,17 +273,17 @@ func timeToMsDosTime(t time.Time) (fDate uint16, fTime uint16) {
273273
}
274274

275275
// ModTime returns the modification time in UTC using the legacy
276-
// ModifiedDate and ModifiedTime fields.
276+
// [ModifiedDate] and [ModifiedTime] fields.
277277
//
278-
// Deprecated: Use Modified instead.
278+
// Deprecated: Use [Modified] instead.
279279
func (h *FileHeader) ModTime() time.Time {
280280
return msDosTimeToTime(h.ModifiedDate, h.ModifiedTime)
281281
}
282282

283-
// SetModTime sets the Modified, ModifiedTime, and ModifiedDate fields
283+
// SetModTime sets the [Modified], [ModifiedTime], and [ModifiedDate] fields
284284
// to the given time in UTC.
285285
//
286-
// Deprecated: Use Modified instead.
286+
// Deprecated: Use [Modified] instead.
287287
func (h *FileHeader) SetModTime(t time.Time) {
288288
t = t.UTC() // Convert to UTC for compatibility
289289
h.Modified = t
@@ -309,7 +309,7 @@ const (
309309
msdosReadOnly = 0x01
310310
)
311311

312-
// Mode returns the permission and mode bits for the FileHeader.
312+
// Mode returns the permission and mode bits for the [FileHeader].
313313
func (h *FileHeader) Mode() (mode fs.FileMode) {
314314
switch h.CreatorVersion >> 8 {
315315
case creatorUnix, creatorMacOSX:
@@ -323,7 +323,7 @@ func (h *FileHeader) Mode() (mode fs.FileMode) {
323323
return mode
324324
}
325325

326-
// SetMode changes the permission and mode bits for the FileHeader.
326+
// SetMode changes the permission and mode bits for the [FileHeader].
327327
func (h *FileHeader) SetMode(mode fs.FileMode) {
328328
h.CreatorVersion = h.CreatorVersion&0xff | creatorUnix<<8
329329
h.ExternalAttrs = fileModeToUnixMode(mode) << 16

0 commit comments

Comments
 (0)