update to latest golang.org/x dependencies

This commit is contained in:
Mechiel Lukkien 2025-04-16 20:01:32 +02:00
parent 1b2b152cb5
commit 805ae0d827
No known key found for this signature in database
35 changed files with 1023 additions and 413 deletions

12
go.mod
View File

@ -15,10 +15,10 @@ require (
github.com/prometheus/client_golang v1.18.0 github.com/prometheus/client_golang v1.18.0
github.com/russross/blackfriday/v2 v2.1.0 github.com/russross/blackfriday/v2 v2.1.0
go.etcd.io/bbolt v1.3.11 go.etcd.io/bbolt v1.3.11
golang.org/x/crypto v0.36.0 golang.org/x/crypto v0.37.0
golang.org/x/net v0.38.0 golang.org/x/net v0.39.0
golang.org/x/sys v0.31.0 golang.org/x/sys v0.32.0
golang.org/x/text v0.23.0 golang.org/x/text v0.24.0
rsc.io/qr v0.2.0 rsc.io/qr v0.2.0
) )
@ -31,7 +31,7 @@ require (
github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect
golang.org/x/mod v0.24.0 // indirect golang.org/x/mod v0.24.0 // indirect
golang.org/x/sync v0.12.0 // indirect golang.org/x/sync v0.13.0 // indirect
golang.org/x/tools v0.31.0 // indirect golang.org/x/tools v0.32.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect google.golang.org/protobuf v1.31.0 // indirect
) )

24
go.sum
View File

@ -75,33 +75,33 @@ go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE=
golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc=
golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro=
golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU= golang.org/x/mod v0.24.0 h1:ZfthKaKaT4NrhGVZHO1/WDTwGES4De8KtWO0SIbNJMU=
golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww= golang.org/x/mod v0.24.0/go.mod h1:IXM97Txy2VM4PJ3gI61r1YEk/gAj6zAHN3AdZt6S9Ww=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= golang.org/x/net v0.39.0 h1:ZCu7HMWDxpXpaiKdhzIfaltL9Lp31x/3fCP11bc6/fY=
golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= golang.org/x/net v0.39.0/go.mod h1:X7NRbYVEA+ewNkCNyJ513WmMdQ3BineSwVtN2zD/d+E=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.12.0 h1:MHc5BpPuC30uJk597Ri8TV3CNZcTLu6B6z4lJy+g6Jw= golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610=
golang.org/x/sync v0.12.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20=
golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0=
golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.31.0 h1:0EedkvKDbh+qistFTd0Bcwe/YLh4vHwWEkiI0toFIBU= golang.org/x/tools v0.32.0 h1:Q7N1vhpkQv7ybVzLFtTjvQya2ewbwNDZzUgfXGqtMWU=
golang.org/x/tools v0.31.0/go.mod h1:naFTU+Cev749tSJRXJlna0T3WxKvb1kWEx15xA4SdmQ= golang.org/x/tools v0.32.0/go.mod h1:ZxrU41P/wAbZD8EDa6dDCa6XfpkhJ7HFMjHJXfBDu8s=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

View File

@ -1,4 +1,4 @@
Copyright (c) 2009 The Go Authors. All rights reserved. Copyright 2009 The Go Authors.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are modification, are permitted provided that the following conditions are
@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer.
copyright notice, this list of conditions and the following disclaimer copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the in the documentation and/or other materials provided with the
distribution. distribution.
* Neither the name of Google Inc. nor the names of its * Neither the name of Google LLC nor the names of its
contributors may be used to endorse or promote products derived from contributors may be used to endorse or promote products derived from
this software without specific prior written permission. this software without specific prior written permission.

View File

@ -1,22 +0,0 @@
Additional IP Rights Grant (Patents)
"This implementation" means the copyrightable works distributed by
Google as part of the Go project.
Google hereby grants to You a perpetual, worldwide, non-exclusive,
no-charge, royalty-free, irrevocable (except as stated in this section)
patent license to make, have made, use, offer to sell, sell, import,
transfer and otherwise run, modify and propagate the contents of this
implementation of Go, where such license applies only to those patent
claims, both currently owned or controlled by Google and acquired in
the future, licensable by Google that are necessarily infringed by this
implementation of Go. This grant does not include claims that would be
infringed only as a consequence of further modification of this
implementation. If you or your agent or exclusive licensee institute or
order or agree to the institution of patent litigation against any
entity (including a cross-claim or counterclaim in a lawsuit) alleging
that this implementation of Go or any code incorporated within this
implementation of Go constitutes direct or contributory patent
infringement, or inducement of patent infringement, then any patent
rights granted to you under this License for this implementation of Go
shall terminate as of the date such litigation is filed.

View File

@ -92,7 +92,7 @@ func jwsEncodeJSON(claimset interface{}, key crypto.Signer, kid KeyID, nonce, ur
if err != nil { if err != nil {
return nil, err return nil, err
} }
phead := base64.RawURLEncoding.EncodeToString([]byte(phJSON)) phead := base64.RawURLEncoding.EncodeToString(phJSON)
var payload string var payload string
if val, ok := claimset.(string); ok { if val, ok := claimset.(string); ok {
payload = val payload = val

View File

@ -18,7 +18,7 @@ import (
type token struct{} type token struct{}
// A Group is a collection of goroutines working on subtasks that are part of // A Group is a collection of goroutines working on subtasks that are part of
// the same overall task. // the same overall task. A Group should not be reused for different tasks.
// //
// A zero Group is valid, has no limit on the number of active goroutines, // A zero Group is valid, has no limit on the number of active goroutines,
// and does not cancel on error. // and does not cancel on error.
@ -61,6 +61,7 @@ func (g *Group) Wait() error {
} }
// Go calls the given function in a new goroutine. // Go calls the given function in a new goroutine.
// The first call to Go must happen before a Wait.
// It blocks until the new goroutine can be added without the number of // It blocks until the new goroutine can be added without the number of
// active goroutines in the group exceeding the configured limit. // active goroutines in the group exceeding the configured limit.
// //

12
vendor/golang.org/x/sys/cpu/cpu.go generated vendored
View File

@ -149,6 +149,18 @@ var ARM struct {
_ CacheLinePad _ CacheLinePad
} }
// The booleans in Loong64 contain the correspondingly named cpu feature bit.
// The struct is padded to avoid false sharing.
var Loong64 struct {
_ CacheLinePad
HasLSX bool // support 128-bit vector extension
HasLASX bool // support 256-bit vector extension
HasCRC32 bool // support CRC instruction
HasLAM_BH bool // support AM{SWAP/ADD}[_DB].{B/H} instruction
HasLAMCAS bool // support AMCAS[_DB].{B/H/W/D} instruction
_ CacheLinePad
}
// MIPS64X contains the supported CPU features of the current mips64/mips64le // MIPS64X contains the supported CPU features of the current mips64/mips64le
// platforms. If the current platform is not mips64/mips64le or the current // platforms. If the current platform is not mips64/mips64le or the current
// operating system is not Linux then all feature flags are false. // operating system is not Linux then all feature flags are false.

22
vendor/golang.org/x/sys/cpu/cpu_linux_loong64.go generated vendored Normal file
View File

@ -0,0 +1,22 @@
// Copyright 2025 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package cpu
// HWCAP bits. These are exposed by the Linux kernel.
const (
hwcap_LOONGARCH_LSX = 1 << 4
hwcap_LOONGARCH_LASX = 1 << 5
)
func doinit() {
// TODO: Features that require kernel support like LSX and LASX can
// be detected here once needed in std library or by the compiler.
Loong64.HasLSX = hwcIsSet(hwCap, hwcap_LOONGARCH_LSX)
Loong64.HasLASX = hwcIsSet(hwCap, hwcap_LOONGARCH_LASX)
}
func hwcIsSet(hwc uint, val uint) bool {
return hwc&val != 0
}

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
//go:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x && !riscv64 //go:build linux && !arm && !arm64 && !loong64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x && !riscv64
package cpu package cpu

View File

@ -8,5 +8,43 @@ package cpu
const cacheLineSize = 64 const cacheLineSize = 64
// Bit fields for CPUCFG registers, Related reference documents:
// https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html#_cpucfg
const (
// CPUCFG1 bits
cpucfg1_CRC32 = 1 << 25
// CPUCFG2 bits
cpucfg2_LAM_BH = 1 << 27
cpucfg2_LAMCAS = 1 << 28
)
func initOptions() { func initOptions() {
options = []option{
{Name: "lsx", Feature: &Loong64.HasLSX},
{Name: "lasx", Feature: &Loong64.HasLASX},
{Name: "crc32", Feature: &Loong64.HasCRC32},
{Name: "lam_bh", Feature: &Loong64.HasLAM_BH},
{Name: "lamcas", Feature: &Loong64.HasLAMCAS},
}
// The CPUCFG data on Loong64 only reflects the hardware capabilities,
// not the kernel support status, so features such as LSX and LASX that
// require kernel support cannot be obtained from the CPUCFG data.
//
// These features only require hardware capability support and do not
// require kernel specific support, so they can be obtained directly
// through CPUCFG
cfg1 := get_cpucfg(1)
cfg2 := get_cpucfg(2)
Loong64.HasCRC32 = cfgIsSet(cfg1, cpucfg1_CRC32)
Loong64.HasLAMCAS = cfgIsSet(cfg2, cpucfg2_LAMCAS)
Loong64.HasLAM_BH = cfgIsSet(cfg2, cpucfg2_LAM_BH)
}
func get_cpucfg(reg uint32) uint32
func cfgIsSet(cfg uint32, val uint32) bool {
return cfg&val != 0
} }

13
vendor/golang.org/x/sys/cpu/cpu_loong64.s generated vendored Normal file
View File

@ -0,0 +1,13 @@
// Copyright 2025 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
#include "textflag.h"
// func get_cpucfg(reg uint32) uint32
TEXT ·get_cpucfg(SB), NOSPLIT|NOFRAME, $0
MOVW reg+0(FP), R5
// CPUCFG R5, R4 = 0x00006ca4
WORD $0x00006ca4
MOVW R4, ret+8(FP)
RET

View File

@ -13,7 +13,7 @@ import "strconv"
// https://golang.org/cl/209597. // https://golang.org/cl/209597.
func parseRelease(rel string) (major, minor, patch int, ok bool) { func parseRelease(rel string) (major, minor, patch int, ok bool) {
// Strip anything after a dash or plus. // Strip anything after a dash or plus.
for i := 0; i < len(rel); i++ { for i := range len(rel) {
if rel[i] == '-' || rel[i] == '+' { if rel[i] == '-' || rel[i] == '+' {
rel = rel[:i] rel = rel[:i]
break break
@ -21,7 +21,7 @@ func parseRelease(rel string) (major, minor, patch int, ok bool) {
} }
next := func() (int, bool) { next := func() (int, bool) {
for i := 0; i < len(rel); i++ { for i := range len(rel) {
if rel[i] == '.' { if rel[i] == '.' {
ver, err := strconv.Atoi(rel[:i]) ver, err := strconv.Atoi(rel[:i])
rel = rel[i+1:] rel = rel[i+1:]

View File

@ -603,6 +603,149 @@ func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocI
} }
// sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error) // sys connectx(fd int, endpoints *SaEndpoints, associd SaeAssocID, flags uint32, iov []Iovec, n *uintptr, connid *SaeConnID) (err error)
const minIovec = 8
func Readv(fd int, iovs [][]byte) (n int, err error) {
if !darwinKernelVersionMin(11, 0, 0) {
return 0, ENOSYS
}
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
n, err = readv(fd, iovecs)
readvRacedetect(iovecs, n, err)
return n, err
}
func Preadv(fd int, iovs [][]byte, offset int64) (n int, err error) {
if !darwinKernelVersionMin(11, 0, 0) {
return 0, ENOSYS
}
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
n, err = preadv(fd, iovecs, offset)
readvRacedetect(iovecs, n, err)
return n, err
}
func Writev(fd int, iovs [][]byte) (n int, err error) {
if !darwinKernelVersionMin(11, 0, 0) {
return 0, ENOSYS
}
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
if raceenabled {
raceReleaseMerge(unsafe.Pointer(&ioSync))
}
n, err = writev(fd, iovecs)
writevRacedetect(iovecs, n)
return n, err
}
func Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error) {
if !darwinKernelVersionMin(11, 0, 0) {
return 0, ENOSYS
}
iovecs := make([]Iovec, 0, minIovec)
iovecs = appendBytes(iovecs, iovs)
if raceenabled {
raceReleaseMerge(unsafe.Pointer(&ioSync))
}
n, err = pwritev(fd, iovecs, offset)
writevRacedetect(iovecs, n)
return n, err
}
func appendBytes(vecs []Iovec, bs [][]byte) []Iovec {
for _, b := range bs {
var v Iovec
v.SetLen(len(b))
if len(b) > 0 {
v.Base = &b[0]
} else {
v.Base = (*byte)(unsafe.Pointer(&_zero))
}
vecs = append(vecs, v)
}
return vecs
}
func writevRacedetect(iovecs []Iovec, n int) {
if !raceenabled {
return
}
for i := 0; n > 0 && i < len(iovecs); i++ {
m := int(iovecs[i].Len)
if m > n {
m = n
}
n -= m
if m > 0 {
raceReadRange(unsafe.Pointer(iovecs[i].Base), m)
}
}
}
func readvRacedetect(iovecs []Iovec, n int, err error) {
if !raceenabled {
return
}
for i := 0; n > 0 && i < len(iovecs); i++ {
m := int(iovecs[i].Len)
if m > n {
m = n
}
n -= m
if m > 0 {
raceWriteRange(unsafe.Pointer(iovecs[i].Base), m)
}
}
if err == nil {
raceAcquire(unsafe.Pointer(&ioSync))
}
}
func darwinMajorMinPatch() (maj, min, patch int, err error) {
var un Utsname
err = Uname(&un)
if err != nil {
return
}
var mmp [3]int
c := 0
Loop:
for _, b := range un.Release[:] {
switch {
case b >= '0' && b <= '9':
mmp[c] = 10*mmp[c] + int(b-'0')
case b == '.':
c++
if c > 2 {
return 0, 0, 0, ENOTSUP
}
case b == 0:
break Loop
default:
return 0, 0, 0, ENOTSUP
}
}
if c != 2 {
return 0, 0, 0, ENOTSUP
}
return mmp[0], mmp[1], mmp[2], nil
}
func darwinKernelVersionMin(maj, min, patch int) bool {
actualMaj, actualMin, actualPatch, err := darwinMajorMinPatch()
if err != nil {
return false
}
return actualMaj > maj || actualMaj == maj && (actualMin > min || actualMin == min && actualPatch >= patch)
}
//sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error) //sys sendfile(infd int, outfd int, offset int64, len *int64, hdtr unsafe.Pointer, flags int) (err error)
//sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error) //sys shmat(id int, addr uintptr, flag int) (ret uintptr, err error)
@ -705,3 +848,7 @@ func Connectx(fd int, srcIf uint32, srcAddr, dstAddr Sockaddr, associd SaeAssocI
//sys write(fd int, p []byte) (n int, err error) //sys write(fd int, p []byte) (n int, err error)
//sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error) //sys mmap(addr uintptr, length uintptr, prot int, flag int, fd int, pos int64) (ret uintptr, err error)
//sys munmap(addr uintptr, length uintptr) (err error) //sys munmap(addr uintptr, length uintptr) (err error)
//sys readv(fd int, iovecs []Iovec) (n int, err error)
//sys preadv(fd int, iovecs []Iovec, offset int64) (n int, err error)
//sys writev(fd int, iovecs []Iovec) (n int, err error)
//sys pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error)

View File

@ -13,6 +13,7 @@ package unix
import ( import (
"encoding/binary" "encoding/binary"
"slices"
"strconv" "strconv"
"syscall" "syscall"
"time" "time"
@ -417,7 +418,7 @@ func (sa *SockaddrUnix) sockaddr() (unsafe.Pointer, _Socklen, error) {
return nil, 0, EINVAL return nil, 0, EINVAL
} }
sa.raw.Family = AF_UNIX sa.raw.Family = AF_UNIX
for i := 0; i < n; i++ { for i := range n {
sa.raw.Path[i] = int8(name[i]) sa.raw.Path[i] = int8(name[i])
} }
// length is family (uint16), name, NUL. // length is family (uint16), name, NUL.
@ -507,7 +508,7 @@ func (sa *SockaddrL2) sockaddr() (unsafe.Pointer, _Socklen, error) {
psm := (*[2]byte)(unsafe.Pointer(&sa.raw.Psm)) psm := (*[2]byte)(unsafe.Pointer(&sa.raw.Psm))
psm[0] = byte(sa.PSM) psm[0] = byte(sa.PSM)
psm[1] = byte(sa.PSM >> 8) psm[1] = byte(sa.PSM >> 8)
for i := 0; i < len(sa.Addr); i++ { for i := range len(sa.Addr) {
sa.raw.Bdaddr[i] = sa.Addr[len(sa.Addr)-1-i] sa.raw.Bdaddr[i] = sa.Addr[len(sa.Addr)-1-i]
} }
cid := (*[2]byte)(unsafe.Pointer(&sa.raw.Cid)) cid := (*[2]byte)(unsafe.Pointer(&sa.raw.Cid))
@ -589,11 +590,11 @@ func (sa *SockaddrCAN) sockaddr() (unsafe.Pointer, _Socklen, error) {
sa.raw.Family = AF_CAN sa.raw.Family = AF_CAN
sa.raw.Ifindex = int32(sa.Ifindex) sa.raw.Ifindex = int32(sa.Ifindex)
rx := (*[4]byte)(unsafe.Pointer(&sa.RxID)) rx := (*[4]byte)(unsafe.Pointer(&sa.RxID))
for i := 0; i < 4; i++ { for i := range 4 {
sa.raw.Addr[i] = rx[i] sa.raw.Addr[i] = rx[i]
} }
tx := (*[4]byte)(unsafe.Pointer(&sa.TxID)) tx := (*[4]byte)(unsafe.Pointer(&sa.TxID))
for i := 0; i < 4; i++ { for i := range 4 {
sa.raw.Addr[i+4] = tx[i] sa.raw.Addr[i+4] = tx[i]
} }
return unsafe.Pointer(&sa.raw), SizeofSockaddrCAN, nil return unsafe.Pointer(&sa.raw), SizeofSockaddrCAN, nil
@ -618,11 +619,11 @@ func (sa *SockaddrCANJ1939) sockaddr() (unsafe.Pointer, _Socklen, error) {
sa.raw.Family = AF_CAN sa.raw.Family = AF_CAN
sa.raw.Ifindex = int32(sa.Ifindex) sa.raw.Ifindex = int32(sa.Ifindex)
n := (*[8]byte)(unsafe.Pointer(&sa.Name)) n := (*[8]byte)(unsafe.Pointer(&sa.Name))
for i := 0; i < 8; i++ { for i := range 8 {
sa.raw.Addr[i] = n[i] sa.raw.Addr[i] = n[i]
} }
p := (*[4]byte)(unsafe.Pointer(&sa.PGN)) p := (*[4]byte)(unsafe.Pointer(&sa.PGN))
for i := 0; i < 4; i++ { for i := range 4 {
sa.raw.Addr[i+8] = p[i] sa.raw.Addr[i+8] = p[i]
} }
sa.raw.Addr[12] = sa.Addr sa.raw.Addr[12] = sa.Addr
@ -911,7 +912,7 @@ func (sa *SockaddrIUCV) sockaddr() (unsafe.Pointer, _Socklen, error) {
// These are EBCDIC encoded by the kernel, but we still need to pad them // These are EBCDIC encoded by the kernel, but we still need to pad them
// with blanks. Initializing with blanks allows the caller to feed in either // with blanks. Initializing with blanks allows the caller to feed in either
// a padded or an unpadded string. // a padded or an unpadded string.
for i := 0; i < 8; i++ { for i := range 8 {
sa.raw.Nodeid[i] = ' ' sa.raw.Nodeid[i] = ' '
sa.raw.User_id[i] = ' ' sa.raw.User_id[i] = ' '
sa.raw.Name[i] = ' ' sa.raw.Name[i] = ' '
@ -1148,7 +1149,7 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
var user [8]byte var user [8]byte
var name [8]byte var name [8]byte
for i := 0; i < 8; i++ { for i := range 8 {
user[i] = byte(pp.User_id[i]) user[i] = byte(pp.User_id[i])
name[i] = byte(pp.Name[i]) name[i] = byte(pp.Name[i])
} }
@ -1173,11 +1174,11 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
Ifindex: int(pp.Ifindex), Ifindex: int(pp.Ifindex),
} }
name := (*[8]byte)(unsafe.Pointer(&sa.Name)) name := (*[8]byte)(unsafe.Pointer(&sa.Name))
for i := 0; i < 8; i++ { for i := range 8 {
name[i] = pp.Addr[i] name[i] = pp.Addr[i]
} }
pgn := (*[4]byte)(unsafe.Pointer(&sa.PGN)) pgn := (*[4]byte)(unsafe.Pointer(&sa.PGN))
for i := 0; i < 4; i++ { for i := range 4 {
pgn[i] = pp.Addr[i+8] pgn[i] = pp.Addr[i+8]
} }
addr := (*[1]byte)(unsafe.Pointer(&sa.Addr)) addr := (*[1]byte)(unsafe.Pointer(&sa.Addr))
@ -1188,11 +1189,11 @@ func anyToSockaddr(fd int, rsa *RawSockaddrAny) (Sockaddr, error) {
Ifindex: int(pp.Ifindex), Ifindex: int(pp.Ifindex),
} }
rx := (*[4]byte)(unsafe.Pointer(&sa.RxID)) rx := (*[4]byte)(unsafe.Pointer(&sa.RxID))
for i := 0; i < 4; i++ { for i := range 4 {
rx[i] = pp.Addr[i] rx[i] = pp.Addr[i]
} }
tx := (*[4]byte)(unsafe.Pointer(&sa.TxID)) tx := (*[4]byte)(unsafe.Pointer(&sa.TxID))
for i := 0; i < 4; i++ { for i := range 4 {
tx[i] = pp.Addr[i+4] tx[i] = pp.Addr[i+4]
} }
return sa, nil return sa, nil
@ -2216,10 +2217,7 @@ func readvRacedetect(iovecs []Iovec, n int, err error) {
return return
} }
for i := 0; n > 0 && i < len(iovecs); i++ { for i := 0; n > 0 && i < len(iovecs); i++ {
m := int(iovecs[i].Len) m := min(int(iovecs[i].Len), n)
if m > n {
m = n
}
n -= m n -= m
if m > 0 { if m > 0 {
raceWriteRange(unsafe.Pointer(iovecs[i].Base), m) raceWriteRange(unsafe.Pointer(iovecs[i].Base), m)
@ -2270,10 +2268,7 @@ func writevRacedetect(iovecs []Iovec, n int) {
return return
} }
for i := 0; n > 0 && i < len(iovecs); i++ { for i := 0; n > 0 && i < len(iovecs); i++ {
m := int(iovecs[i].Len) m := min(int(iovecs[i].Len), n)
if m > n {
m = n
}
n -= m n -= m
if m > 0 { if m > 0 {
raceReadRange(unsafe.Pointer(iovecs[i].Base), m) raceReadRange(unsafe.Pointer(iovecs[i].Base), m)
@ -2320,12 +2315,7 @@ func isGroupMember(gid int) bool {
return false return false
} }
for _, g := range groups { return slices.Contains(groups, gid)
if g == gid {
return true
}
}
return false
} }
func isCapDacOverrideSet() bool { func isCapDacOverrideSet() bool {

View File

@ -2512,6 +2512,90 @@ var libc_munmap_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readv(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_readv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_readv readv "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_preadv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_preadv preadv "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func writev(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_writev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_writev writev "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_pwritev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_pwritev pwritev "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fstat(fd int, stat *Stat_t) (err error) { func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := syscall_syscall(libc_fstat64_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := syscall_syscall(libc_fstat64_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 { if e1 != 0 {

View File

@ -738,6 +738,26 @@ TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8
DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB)
TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_readv(SB)
GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8
DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB)
TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_preadv(SB)
GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8
DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB)
TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_writev(SB)
GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8
DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB)
TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pwritev(SB)
GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8
DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB)
TEXT libc_fstat64_trampoline<>(SB),NOSPLIT,$0-0 TEXT libc_fstat64_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fstat64(SB) JMP libc_fstat64(SB)
GLOBL ·libc_fstat64_trampoline_addr(SB), RODATA, $8 GLOBL ·libc_fstat64_trampoline_addr(SB), RODATA, $8

View File

@ -2512,6 +2512,90 @@ var libc_munmap_trampoline_addr uintptr
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func readv(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_readv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_readv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_readv readv "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func preadv(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_preadv_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_preadv_trampoline_addr uintptr
//go:cgo_import_dynamic libc_preadv preadv "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func writev(fd int, iovecs []Iovec) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall(libc_writev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)))
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_writev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_writev writev "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func pwritev(fd int, iovecs []Iovec, offset int64) (n int, err error) {
var _p0 unsafe.Pointer
if len(iovecs) > 0 {
_p0 = unsafe.Pointer(&iovecs[0])
} else {
_p0 = unsafe.Pointer(&_zero)
}
r0, _, e1 := syscall_syscall6(libc_pwritev_trampoline_addr, uintptr(fd), uintptr(_p0), uintptr(len(iovecs)), uintptr(offset), 0, 0)
n = int(r0)
if e1 != 0 {
err = errnoErr(e1)
}
return
}
var libc_pwritev_trampoline_addr uintptr
//go:cgo_import_dynamic libc_pwritev pwritev "/usr/lib/libSystem.B.dylib"
// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
func Fstat(fd int, stat *Stat_t) (err error) { func Fstat(fd int, stat *Stat_t) (err error) {
_, _, e1 := syscall_syscall(libc_fstat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0) _, _, e1 := syscall_syscall(libc_fstat_trampoline_addr, uintptr(fd), uintptr(unsafe.Pointer(stat)), 0)
if e1 != 0 { if e1 != 0 {

View File

@ -738,6 +738,26 @@ TEXT libc_munmap_trampoline<>(SB),NOSPLIT,$0-0
GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8 GLOBL ·libc_munmap_trampoline_addr(SB), RODATA, $8
DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB) DATA ·libc_munmap_trampoline_addr(SB)/8, $libc_munmap_trampoline<>(SB)
TEXT libc_readv_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_readv(SB)
GLOBL ·libc_readv_trampoline_addr(SB), RODATA, $8
DATA ·libc_readv_trampoline_addr(SB)/8, $libc_readv_trampoline<>(SB)
TEXT libc_preadv_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_preadv(SB)
GLOBL ·libc_preadv_trampoline_addr(SB), RODATA, $8
DATA ·libc_preadv_trampoline_addr(SB)/8, $libc_preadv_trampoline<>(SB)
TEXT libc_writev_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_writev(SB)
GLOBL ·libc_writev_trampoline_addr(SB), RODATA, $8
DATA ·libc_writev_trampoline_addr(SB)/8, $libc_writev_trampoline<>(SB)
TEXT libc_pwritev_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_pwritev(SB)
GLOBL ·libc_pwritev_trampoline_addr(SB), RODATA, $8
DATA ·libc_pwritev_trampoline_addr(SB)/8, $libc_pwritev_trampoline<>(SB)
TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0 TEXT libc_fstat_trampoline<>(SB),NOSPLIT,$0-0
JMP libc_fstat(SB) JMP libc_fstat(SB)
GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $8 GLOBL ·libc_fstat_trampoline_addr(SB), RODATA, $8

View File

@ -1074,6 +1074,7 @@ const (
IP_ADD_MEMBERSHIP = 0xc IP_ADD_MEMBERSHIP = 0xc
IP_DROP_MEMBERSHIP = 0xd IP_DROP_MEMBERSHIP = 0xd
IP_PKTINFO = 0x13 IP_PKTINFO = 0x13
IP_MTU_DISCOVER = 0x47
IPV6_V6ONLY = 0x1b IPV6_V6ONLY = 0x1b
IPV6_UNICAST_HOPS = 0x4 IPV6_UNICAST_HOPS = 0x4
@ -1083,6 +1084,7 @@ const (
IPV6_JOIN_GROUP = 0xc IPV6_JOIN_GROUP = 0xc
IPV6_LEAVE_GROUP = 0xd IPV6_LEAVE_GROUP = 0xd
IPV6_PKTINFO = 0x13 IPV6_PKTINFO = 0x13
IPV6_MTU_DISCOVER = 0x47
MSG_OOB = 0x1 MSG_OOB = 0x1
MSG_PEEK = 0x2 MSG_PEEK = 0x2
@ -1132,6 +1134,15 @@ const (
WSASYS_STATUS_LEN = 128 WSASYS_STATUS_LEN = 128
) )
// enum PMTUD_STATE from ws2ipdef.h
const (
IP_PMTUDISC_NOT_SET = 0
IP_PMTUDISC_DO = 1
IP_PMTUDISC_DONT = 2
IP_PMTUDISC_PROBE = 3
IP_PMTUDISC_MAX = 4
)
type WSABuf struct { type WSABuf struct {
Len uint32 Len uint32
Buf *byte Buf *byte
@ -1146,6 +1157,22 @@ type WSAMsg struct {
Flags uint32 Flags uint32
} }
type WSACMSGHDR struct {
Len uintptr
Level int32
Type int32
}
type IN_PKTINFO struct {
Addr [4]byte
Ifindex uint32
}
type IN6_PKTINFO struct {
Addr [16]byte
Ifindex uint32
}
// Flags for WSASocket // Flags for WSASocket
const ( const (
WSA_FLAG_OVERLAPPED = 0x01 WSA_FLAG_OVERLAPPED = 0x01

View File

@ -193,10 +193,7 @@ func Read(in io.Reader, fset *token.FileSet, imports map[string]*types.Package,
return pkg, err return pkg, err
default: default:
l := len(data) l := min(len(data), 10)
if l > 10 {
l = 10
}
return nil, fmt.Errorf("unexpected export data with prefix %q for path %s", string(data[:l]), path) return nil, fmt.Errorf("unexpected export data with prefix %q for path %s", string(data[:l]), path)
} }
} }

View File

@ -90,7 +90,7 @@ func findExternalDriver(cfg *Config) driver {
const toolPrefix = "GOPACKAGESDRIVER=" const toolPrefix = "GOPACKAGESDRIVER="
tool := "" tool := ""
for _, env := range cfg.Env { for _, env := range cfg.Env {
if val := strings.TrimPrefix(env, toolPrefix); val != env { if val, ok := strings.CutPrefix(env, toolPrefix); ok {
tool = val tool = val
} }
} }

View File

@ -7,45 +7,23 @@ package typeutil
import ( import (
"go/ast" "go/ast"
"go/types" "go/types"
_ "unsafe" // for linkname
"golang.org/x/tools/internal/typeparams"
) )
// Callee returns the named target of a function call, if any: // Callee returns the named target of a function call, if any:
// a function, method, builtin, or variable. // a function, method, builtin, or variable.
// //
// Functions and methods may potentially have type parameters. // Functions and methods may potentially have type parameters.
//
// Note: for calls of instantiated functions and methods, Callee returns
// the corresponding generic function or method on the generic type.
func Callee(info *types.Info, call *ast.CallExpr) types.Object { func Callee(info *types.Info, call *ast.CallExpr) types.Object {
fun := ast.Unparen(call.Fun) obj := info.Uses[usedIdent(info, call.Fun)]
if obj == nil {
// Look through type instantiation if necessary. return nil
isInstance := false
switch fun.(type) {
case *ast.IndexExpr, *ast.IndexListExpr:
// When extracting the callee from an *IndexExpr, we need to check that
// it is a *types.Func and not a *types.Var.
// Example: Don't match a slice m within the expression `m[0]()`.
isInstance = true
fun, _, _, _ = typeparams.UnpackIndexExpr(fun)
}
var obj types.Object
switch fun := fun.(type) {
case *ast.Ident:
obj = info.Uses[fun] // type, var, builtin, or declared func
case *ast.SelectorExpr:
if sel, ok := info.Selections[fun]; ok {
obj = sel.Obj() // method or field
} else {
obj = info.Uses[fun.Sel] // qualified identifier?
}
} }
if _, ok := obj.(*types.TypeName); ok { if _, ok := obj.(*types.TypeName); ok {
return nil // T(x) is a conversion, not a call return nil
}
// A Func is required to match instantiations.
if _, ok := obj.(*types.Func); isInstance && !ok {
return nil // Was not a Func.
} }
return obj return obj
} }
@ -56,13 +34,52 @@ func Callee(info *types.Info, call *ast.CallExpr) types.Object {
// Note: for calls of instantiated functions and methods, StaticCallee returns // Note: for calls of instantiated functions and methods, StaticCallee returns
// the corresponding generic function or method on the generic type. // the corresponding generic function or method on the generic type.
func StaticCallee(info *types.Info, call *ast.CallExpr) *types.Func { func StaticCallee(info *types.Info, call *ast.CallExpr) *types.Func {
if f, ok := Callee(info, call).(*types.Func); ok && !interfaceMethod(f) { obj := info.Uses[usedIdent(info, call.Fun)]
return f fn, _ := obj.(*types.Func)
if fn == nil || interfaceMethod(fn) {
return nil
}
return fn
}
// usedIdent is the implementation of [internal/typesinternal.UsedIdent].
// It returns the identifier associated with e.
// See typesinternal.UsedIdent for a fuller description.
// This function should live in typesinternal, but cannot because it would
// create an import cycle.
//
//go:linkname usedIdent
func usedIdent(info *types.Info, e ast.Expr) *ast.Ident {
if info.Types == nil || info.Uses == nil {
panic("one of info.Types or info.Uses is nil; both must be populated")
}
// Look through type instantiation if necessary.
switch d := ast.Unparen(e).(type) {
case *ast.IndexExpr:
if info.Types[d.Index].IsType() {
e = d.X
}
case *ast.IndexListExpr:
e = d.X
}
switch e := ast.Unparen(e).(type) {
// info.Uses always has the object we want, even for selector expressions.
// We don't need info.Selections.
// See go/types/recording.go:recordSelection.
case *ast.Ident:
return e
case *ast.SelectorExpr:
return e.Sel
} }
return nil return nil
} }
// interfaceMethod reports whether its argument is a method of an interface.
// This function should live in typesinternal, but cannot because it would create an import cycle.
//
//go:linkname interfaceMethod
func interfaceMethod(f *types.Func) bool { func interfaceMethod(f *types.Func) bool {
recv := f.Type().(*types.Signature).Recv() recv := f.Signature().Recv()
return recv != nil && types.IsInterface(recv.Type()) return recv != nil && types.IsInterface(recv.Type())
} }

View File

@ -8,6 +8,7 @@ import (
"fmt" "fmt"
"io" "io"
"reflect" "reflect"
"slices"
"unsafe" "unsafe"
) )
@ -154,11 +155,9 @@ func (f *filter) Valid(index int) bool {
func (f *filter) Label(index int) Label { func (f *filter) Label(index int) Label {
l := f.underlying.Label(index) l := f.underlying.Label(index)
for _, f := range f.keys { if slices.Contains(f.keys, l.Key()) {
if l.Key() == f {
return Label{} return Label{}
} }
}
return l return l
} }

View File

@ -236,6 +236,7 @@ import (
"io" "io"
"math/big" "math/big"
"reflect" "reflect"
"slices"
"sort" "sort"
"strconv" "strconv"
"strings" "strings"
@ -271,10 +272,10 @@ import (
// file system, be sure to include a cryptographic digest of the executable in // file system, be sure to include a cryptographic digest of the executable in
// the key to avoid version skew. // the key to avoid version skew.
// //
// If the provided reportf func is non-nil, it will be used for reporting bugs // If the provided reportf func is non-nil, it is used for reporting
// encountered during export. // bugs (e.g. recovered panics) encountered during export, enabling us
// TODO(rfindley): remove reportf when we are confident enough in the new // to obtain via telemetry the stack that would otherwise be lost by
// objectpath encoding. // merely returning an error.
func IExportShallow(fset *token.FileSet, pkg *types.Package, reportf ReportFunc) ([]byte, error) { func IExportShallow(fset *token.FileSet, pkg *types.Package, reportf ReportFunc) ([]byte, error) {
// In principle this operation can only fail if out.Write fails, // In principle this operation can only fail if out.Write fails,
// but that's impossible for bytes.Buffer---and as a matter of // but that's impossible for bytes.Buffer---and as a matter of
@ -283,7 +284,7 @@ func IExportShallow(fset *token.FileSet, pkg *types.Package, reportf ReportFunc)
// TODO(adonovan): use byte slices throughout, avoiding copying. // TODO(adonovan): use byte slices throughout, avoiding copying.
const bundle, shallow = false, true const bundle, shallow = false, true
var out bytes.Buffer var out bytes.Buffer
err := iexportCommon(&out, fset, bundle, shallow, iexportVersion, []*types.Package{pkg}) err := iexportCommon(&out, fset, bundle, shallow, iexportVersion, []*types.Package{pkg}, reportf)
return out.Bytes(), err return out.Bytes(), err
} }
@ -323,20 +324,27 @@ const bundleVersion = 0
// so that calls to IImportData can override with a provided package path. // so that calls to IImportData can override with a provided package path.
func IExportData(out io.Writer, fset *token.FileSet, pkg *types.Package) error { func IExportData(out io.Writer, fset *token.FileSet, pkg *types.Package) error {
const bundle, shallow = false, false const bundle, shallow = false, false
return iexportCommon(out, fset, bundle, shallow, iexportVersion, []*types.Package{pkg}) return iexportCommon(out, fset, bundle, shallow, iexportVersion, []*types.Package{pkg}, nil)
} }
// IExportBundle writes an indexed export bundle for pkgs to out. // IExportBundle writes an indexed export bundle for pkgs to out.
func IExportBundle(out io.Writer, fset *token.FileSet, pkgs []*types.Package) error { func IExportBundle(out io.Writer, fset *token.FileSet, pkgs []*types.Package) error {
const bundle, shallow = true, false const bundle, shallow = true, false
return iexportCommon(out, fset, bundle, shallow, iexportVersion, pkgs) return iexportCommon(out, fset, bundle, shallow, iexportVersion, pkgs, nil)
} }
func iexportCommon(out io.Writer, fset *token.FileSet, bundle, shallow bool, version int, pkgs []*types.Package) (err error) { func iexportCommon(out io.Writer, fset *token.FileSet, bundle, shallow bool, version int, pkgs []*types.Package, reportf ReportFunc) (err error) {
if !debug { if !debug {
defer func() { defer func() {
if e := recover(); e != nil { if e := recover(); e != nil {
// Report the stack via telemetry (see #71067).
if reportf != nil {
reportf("panic in exporter")
}
if ierr, ok := e.(internalError); ok { if ierr, ok := e.(internalError); ok {
// internalError usually means we exported a
// bad go/types data structure: a violation
// of an implicit precondition of Export.
err = ierr err = ierr
return return
} }
@ -458,7 +466,7 @@ func (p *iexporter) encodeFile(w *intWriter, file *token.File, needed []uint64)
w.uint64(size) w.uint64(size)
// Sort the set of needed offsets. Duplicates are harmless. // Sort the set of needed offsets. Duplicates are harmless.
sort.Slice(needed, func(i, j int) bool { return needed[i] < needed[j] }) slices.Sort(needed)
lines := file.Lines() // byte offset of each line start lines := file.Lines() // byte offset of each line start
w.uint64(uint64(len(lines))) w.uint64(uint64(len(lines)))
@ -812,7 +820,7 @@ func (p *iexporter) doDecl(obj types.Object) {
n := named.NumMethods() n := named.NumMethods()
w.uint64(uint64(n)) w.uint64(uint64(n))
for i := 0; i < n; i++ { for i := range n {
m := named.Method(i) m := named.Method(i)
w.pos(m.Pos()) w.pos(m.Pos())
w.string(m.Name()) w.string(m.Name())
@ -1089,7 +1097,7 @@ func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) {
w.pkg(fieldPkg) w.pkg(fieldPkg)
w.uint64(uint64(n)) w.uint64(uint64(n))
for i := 0; i < n; i++ { for i := range n {
f := t.Field(i) f := t.Field(i)
if w.p.shallow { if w.p.shallow {
w.objectPath(f) w.objectPath(f)
@ -1138,7 +1146,7 @@ func (w *exportWriter) doTyp(t types.Type, pkg *types.Package) {
w.startType(unionType) w.startType(unionType)
nt := t.Len() nt := t.Len()
w.uint64(uint64(nt)) w.uint64(uint64(nt))
for i := 0; i < nt; i++ { for i := range nt {
term := t.Term(i) term := t.Term(i)
w.bool(term.Tilde()) w.bool(term.Tilde())
w.typ(term.Type(), pkg) w.typ(term.Type(), pkg)
@ -1267,7 +1275,7 @@ func tparamName(exportName string) string {
func (w *exportWriter) paramList(tup *types.Tuple) { func (w *exportWriter) paramList(tup *types.Tuple) {
n := tup.Len() n := tup.Len()
w.uint64(uint64(n)) w.uint64(uint64(n))
for i := 0; i < n; i++ { for i := range n {
w.param(tup.At(i)) w.param(tup.At(i))
} }
} }

View File

@ -16,6 +16,7 @@ import (
"go/types" "go/types"
"io" "io"
"math/big" "math/big"
"slices"
"sort" "sort"
"strings" "strings"
@ -314,7 +315,7 @@ func iimportCommon(fset *token.FileSet, getPackages GetPackagesFunc, data []byte
pkgs = pkgList[:1] pkgs = pkgList[:1]
// record all referenced packages as imports // record all referenced packages as imports
list := append(([]*types.Package)(nil), pkgList[1:]...) list := slices.Clone(pkgList[1:])
sort.Sort(byPath(list)) sort.Sort(byPath(list))
pkgs[0].SetImports(list) pkgs[0].SetImports(list)
} }

View File

@ -141,7 +141,7 @@ func (runner *Runner) runPiped(ctx context.Context, inv Invocation, stdout, stde
// Wait for all in-progress go commands to return before proceeding, // Wait for all in-progress go commands to return before proceeding,
// to avoid load concurrency errors. // to avoid load concurrency errors.
for i := 0; i < maxInFlight; i++ { for range maxInFlight {
select { select {
case <-ctx.Done(): case <-ctx.Done():
return ctx.Err(), ctx.Err() return ctx.Err(), ctx.Err()

View File

@ -259,7 +259,7 @@ func (r *Decoder) rawUvarint() uint64 {
func readUvarint(r *strings.Reader) (uint64, error) { func readUvarint(r *strings.Reader) (uint64, error) {
var x uint64 var x uint64
var s uint var s uint
for i := 0; i < binary.MaxVarintLen64; i++ { for i := range binary.MaxVarintLen64 {
b, err := r.ReadByte() b, err := r.ReadByte()
if err != nil { if err != nil {
if i > 0 && err == io.EOF { if i > 0 && err == io.EOF {

View File

@ -12,348 +12,348 @@ type pkginfo struct {
} }
var deps = [...]pkginfo{ var deps = [...]pkginfo{
{"archive/tar", "\x03k\x03E5\x01\v\x01#\x01\x01\x02\x05\t\x02\x01\x02\x02\v"}, {"archive/tar", "\x03j\x03E6\x01\v\x01\"\x01\x01\x02\x05\n\x02\x01\x02\x02\v"},
{"archive/zip", "\x02\x04a\a\x16\x0205\x01+\x05\x01\x10\x03\x02\r\x04"}, {"archive/zip", "\x02\x04`\a\x16\x0206\x01*\x05\x01\x11\x03\x02\r\x04"},
{"bufio", "\x03k}E\x13"}, {"bufio", "\x03j~E\x13"},
{"bytes", "n+R\x03\fG\x02\x02"}, {"bytes", "m+S\x03\fG\x02\x02"},
{"cmp", ""}, {"cmp", ""},
{"compress/bzip2", "\x02\x02\xe7\x01B"}, {"compress/bzip2", "\x02\x02\xe7\x01B"},
{"compress/flate", "\x02l\x03z\r\x024\x01\x03"}, {"compress/flate", "\x02k\x03{\r\x024\x01\x03"},
{"compress/gzip", "\x02\x04a\a\x03\x15eT"}, {"compress/gzip", "\x02\x04`\a\x03\x15fT"},
{"compress/lzw", "\x02l\x03z"}, {"compress/lzw", "\x02k\x03{"},
{"compress/zlib", "\x02\x04a\a\x03\x13\x01f"}, {"compress/zlib", "\x02\x04`\a\x03\x13\x01g"},
{"container/heap", "\xae\x02"}, {"container/heap", "\xae\x02"},
{"container/list", ""}, {"container/list", ""},
{"container/ring", ""}, {"container/ring", ""},
{"context", "n\\h\x01\f"}, {"context", "m\\i\x01\f"},
{"crypto", "\x84\x01gD"}, {"crypto", "\x83\x01hD"},
{"crypto/aes", "\x10\n\a\x8e\x02"}, {"crypto/aes", "\x10\n\a\x8e\x02"},
{"crypto/cipher", "\x03\x1e\x01\x01\x1d\x11\x1d,Q"}, {"crypto/cipher", "\x03\x1e\x01\x01\x1d\x11\x1c,R"},
{"crypto/des", "\x10\x13\x1d.,\x95\x01\x03"}, {"crypto/des", "\x10\x13\x1d-,\x96\x01\x03"},
{"crypto/dsa", "@\x04*}\x0e"}, {"crypto/dsa", "@\x04)~\x0e"},
{"crypto/ecdh", "\x03\v\f\x0e\x04\x14\x04\r\x1d}"}, {"crypto/ecdh", "\x03\v\f\x0e\x04\x14\x04\r\x1c~"},
{"crypto/ecdsa", "\x0e\x05\x03\x04\x01\x0e\x16\x01\x04\f\x01\x1d}\x0e\x04K\x01"}, {"crypto/ecdsa", "\x0e\x05\x03\x04\x01\x0e\x16\x01\x04\f\x01\x1c~\x0e\x04K\x01"},
{"crypto/ed25519", "\x0e\x1c\x16\n\a\x1d}D"}, {"crypto/ed25519", "\x0e\x1c\x16\n\a\x1c~D"},
{"crypto/elliptic", "0>}\x0e9"}, {"crypto/elliptic", "0=~\x0e9"},
{"crypto/fips140", " \x05\x91\x01"}, {"crypto/fips140", " \x05\x90\x01"},
{"crypto/hkdf", "-\x12\x01.\x16"}, {"crypto/hkdf", "-\x12\x01-\x16"},
{"crypto/hmac", "\x1a\x14\x11\x01\x113"}, {"crypto/hmac", "\x1a\x14\x11\x01\x112"},
{"crypto/internal/boring", "\x0e\x02\rg"}, {"crypto/internal/boring", "\x0e\x02\rf"},
{"crypto/internal/boring/bbig", "\x1a\xdf\x01L"}, {"crypto/internal/boring/bbig", "\x1a\xdf\x01L"},
{"crypto/internal/boring/bcache", "\xb3\x02\x12"}, {"crypto/internal/boring/bcache", "\xb3\x02\x12"},
{"crypto/internal/boring/sig", ""}, {"crypto/internal/boring/sig", ""},
{"crypto/internal/cryptotest", "\x03\r\n)\x0e\x1a\x06\x13\x12#\a\t\x11\x11\x11\x1b\x01\f\f\x05\n"}, {"crypto/internal/cryptotest", "\x03\r\n)\x0e\x19\x06\x13\x12#\a\t\x11\x12\x11\x1a\r\r\x05\n"},
{"crypto/internal/entropy", "E"}, {"crypto/internal/entropy", "E"},
{"crypto/internal/fips140", ">0}9\f\x15"}, {"crypto/internal/fips140", ">/~8\r\x15"},
{"crypto/internal/fips140/aes", "\x03\x1d\x03\x02\x13\x04\x01\x01\x05+\x8c\x015"}, {"crypto/internal/fips140/aes", "\x03\x1d\x03\x02\x13\x04\x01\x01\x05*\x8d\x015"},
{"crypto/internal/fips140/aes/gcm", " \x01\x02\x02\x02\x11\x04\x01\x06+\x8a\x01"}, {"crypto/internal/fips140/aes/gcm", " \x01\x02\x02\x02\x11\x04\x01\x06*\x8b\x01"},
{"crypto/internal/fips140/alias", "\xc5\x02"}, {"crypto/internal/fips140/alias", "\xc5\x02"},
{"crypto/internal/fips140/bigmod", "%\x17\x01\x06+\x8c\x01"}, {"crypto/internal/fips140/bigmod", "%\x17\x01\x06*\x8d\x01"},
{"crypto/internal/fips140/check", " \x0e\x06\b\x02\xad\x01Z"}, {"crypto/internal/fips140/check", " \x0e\x06\b\x02\xad\x01Z"},
{"crypto/internal/fips140/check/checktest", "%\xff\x01!"}, {"crypto/internal/fips140/check/checktest", "%\xfe\x01\""},
{"crypto/internal/fips140/drbg", "\x03\x1c\x01\x01\x04\x13\x04\b\x01)}\x0f8"}, {"crypto/internal/fips140/drbg", "\x03\x1c\x01\x01\x04\x13\x04\b\x01(~\x0f8"},
{"crypto/internal/fips140/ecdh", "\x03\x1d\x05\x02\t\f2}\x0f8"}, {"crypto/internal/fips140/ecdh", "\x03\x1d\x05\x02\t\f1~\x0f8"},
{"crypto/internal/fips140/ecdsa", "\x03\x1d\x04\x01\x02\a\x02\x068}G"}, {"crypto/internal/fips140/ecdsa", "\x03\x1d\x04\x01\x02\a\x02\x067~G"},
{"crypto/internal/fips140/ed25519", "\x03\x1d\x05\x02\x04\v8\xc1\x01\x03"}, {"crypto/internal/fips140/ed25519", "\x03\x1d\x05\x02\x04\v7\xc2\x01\x03"},
{"crypto/internal/fips140/edwards25519", "%\a\f\x042\x8c\x018"}, {"crypto/internal/fips140/edwards25519", "%\a\f\x041\x8d\x018"},
{"crypto/internal/fips140/edwards25519/field", "%\x13\x042\x8c\x01"}, {"crypto/internal/fips140/edwards25519/field", "%\x13\x041\x8d\x01"},
{"crypto/internal/fips140/hkdf", "\x03\x1d\x05\t\x06:"}, {"crypto/internal/fips140/hkdf", "\x03\x1d\x05\t\x069"},
{"crypto/internal/fips140/hmac", "\x03\x1d\x14\x01\x018"}, {"crypto/internal/fips140/hmac", "\x03\x1d\x14\x01\x017"},
{"crypto/internal/fips140/mlkem", "\x03\x1d\x05\x02\x0e\x03\x042"}, {"crypto/internal/fips140/mlkem", "\x03\x1d\x05\x02\x0e\x03\x041"},
{"crypto/internal/fips140/nistec", "%\f\a\x042\x8c\x01*\x0e\x13"}, {"crypto/internal/fips140/nistec", "%\f\a\x041\x8d\x01)\x0f\x13"},
{"crypto/internal/fips140/nistec/fiat", "%\x136\x8c\x01"}, {"crypto/internal/fips140/nistec/fiat", "%\x135\x8d\x01"},
{"crypto/internal/fips140/pbkdf2", "\x03\x1d\x05\t\x06:"}, {"crypto/internal/fips140/pbkdf2", "\x03\x1d\x05\t\x069"},
{"crypto/internal/fips140/rsa", "\x03\x1d\x04\x01\x02\r\x01\x01\x026}G"}, {"crypto/internal/fips140/rsa", "\x03\x1d\x04\x01\x02\r\x01\x01\x025~G"},
{"crypto/internal/fips140/sha256", "\x03\x1d\x1c\x01\x06+\x8c\x01"}, {"crypto/internal/fips140/sha256", "\x03\x1d\x1c\x01\x06*\x8d\x01"},
{"crypto/internal/fips140/sha3", "\x03\x1d\x18\x04\x011\x8c\x01K"}, {"crypto/internal/fips140/sha3", "\x03\x1d\x18\x04\x010\x8d\x01K"},
{"crypto/internal/fips140/sha512", "\x03\x1d\x1c\x01\x06+\x8c\x01"}, {"crypto/internal/fips140/sha512", "\x03\x1d\x1c\x01\x06*\x8d\x01"},
{"crypto/internal/fips140/ssh", " \x05"}, {"crypto/internal/fips140/ssh", " \x05"},
{"crypto/internal/fips140/subtle", "#\x19\xbe\x01"}, {"crypto/internal/fips140/subtle", "#"},
{"crypto/internal/fips140/tls12", "\x03\x1d\x05\t\x06\x028"}, {"crypto/internal/fips140/tls12", "\x03\x1d\x05\t\x06\x027"},
{"crypto/internal/fips140/tls13", "\x03\x1d\x05\b\a\b2"}, {"crypto/internal/fips140/tls13", "\x03\x1d\x05\b\a\b1"},
{"crypto/internal/fips140deps", ""}, {"crypto/internal/fips140deps", ""},
{"crypto/internal/fips140deps/byteorder", "\x9a\x01"}, {"crypto/internal/fips140deps/byteorder", "\x99\x01"},
{"crypto/internal/fips140deps/cpu", "\xae\x01\a"}, {"crypto/internal/fips140deps/cpu", "\xad\x01\a"},
{"crypto/internal/fips140deps/godebug", "\xb6\x01"}, {"crypto/internal/fips140deps/godebug", "\xb5\x01"},
{"crypto/internal/fips140hash", "5\x1a5\xc1\x01"}, {"crypto/internal/fips140hash", "5\x1a4\xc2\x01"},
{"crypto/internal/fips140only", "'\r\x01\x01N25"}, {"crypto/internal/fips140only", "'\r\x01\x01M26"},
{"crypto/internal/fips140test", ""}, {"crypto/internal/fips140test", ""},
{"crypto/internal/hpke", "\x0e\x01\x01\x03\x1a\x1d$,`M"}, {"crypto/internal/hpke", "\x0e\x01\x01\x03\x1a\x1d#,aM"},
{"crypto/internal/impl", "\xb0\x02"}, {"crypto/internal/impl", "\xb0\x02"},
{"crypto/internal/randutil", "\xeb\x01\x12"}, {"crypto/internal/randutil", "\xeb\x01\x12"},
{"crypto/internal/sysrand", "\xd7\x01@\x1b\x01\f\x06"}, {"crypto/internal/sysrand", "mi\"\x1e\r\x0f\x01\x01\v\x06"},
{"crypto/internal/sysrand/internal/seccomp", "n"}, {"crypto/internal/sysrand/internal/seccomp", "m"},
{"crypto/md5", "\x0e2.\x16\x16`"}, {"crypto/md5", "\x0e2-\x16\x16a"},
{"crypto/mlkem", "/"}, {"crypto/mlkem", "/"},
{"crypto/pbkdf2", "2\r\x01.\x16"}, {"crypto/pbkdf2", "2\r\x01-\x16"},
{"crypto/rand", "\x1a\x06\a\x19\x04\x01)}\x0eL"}, {"crypto/rand", "\x1a\x06\a\x19\x04\x01(~\x0eL"},
{"crypto/rc4", "#\x1d.\xc1\x01"}, {"crypto/rc4", "#\x1d-\xc2\x01"},
{"crypto/rsa", "\x0e\f\x01\t\x0f\f\x01\x04\x06\a\x1d\x03\x1325\r\x01"}, {"crypto/rsa", "\x0e\f\x01\t\x0f\f\x01\x04\x06\a\x1c\x03\x1326\r\x01"},
{"crypto/sha1", "\x0e\f&.\x16\x16\x14L"}, {"crypto/sha1", "\x0e\f&-\x16\x16\x14M"},
{"crypto/sha256", "\x0e\f\x1aP"}, {"crypto/sha256", "\x0e\f\x1aO"},
{"crypto/sha3", "\x0e'O\xc1\x01"}, {"crypto/sha3", "\x0e'N\xc2\x01"},
{"crypto/sha512", "\x0e\f\x1cN"}, {"crypto/sha512", "\x0e\f\x1cM"},
{"crypto/subtle", "8\x98\x01T"}, {"crypto/subtle", "8\x96\x01U"},
{"crypto/tls", "\x03\b\x02\x01\x01\x01\x01\x02\x01\x01\x01\x03\x01\a\x01\v\x02\n\x01\b\x05\x03\x01\x01\x01\x01\x02\x01\x02\x01\x18\x02\x03\x13\x16\x14\b5\x16\x16\r\t\x01\x01\x01\x02\x01\f\x06\x02\x01"}, {"crypto/tls", "\x03\b\x02\x01\x01\x01\x01\x02\x01\x01\x01\x03\x01\a\x01\v\x02\n\x01\b\x05\x03\x01\x01\x01\x01\x02\x01\x02\x01\x17\x02\x03\x13\x16\x14\b6\x16\x15\r\n\x01\x01\x01\x02\x01\f\x06\x02\x01"},
{"crypto/tls/internal/fips140tls", " \x93\x02"}, {"crypto/tls/internal/fips140tls", " \x93\x02"},
{"crypto/x509", "\x03\v\x01\x01\x01\x01\x01\x01\x01\x011\x03\x02\x01\x01\x02\x05\x01\x0e\x06\x02\x02\x03E5\x03\t\x01\x01\x01\a\x10\x05\t\x05\v\x01\x02\r\x02\x01\x01\x02\x03\x01"}, {"crypto/x509", "\x03\v\x01\x01\x01\x01\x01\x01\x01\x011\x03\x02\x01\x01\x02\x05\x0e\x06\x02\x02\x03E\x033\x01\x02\t\x01\x01\x01\a\x0f\x05\x01\x06\x02\x05\f\x01\x02\r\x02\x01\x01\x02\x03\x01"},
{"crypto/x509/internal/macos", "\x03k'\x8f\x01\v\x10\x06"}, {"crypto/x509/pkix", "c\x06\a\x89\x01F"},
{"crypto/x509/pkix", "d\x06\a\x88\x01F"}, {"database/sql", "\x03\nJ\x16\x03{\f\x06!\x05\n\x02\x03\x01\f\x02\x02\x02"},
{"database/sql", "\x03\nK\x16\x03z\f\x06\"\x05\t\x02\x03\x01\f\x02\x02\x02"}, {"database/sql/driver", "\r`\x03\xae\x01\x11\x10"},
{"database/sql/driver", "\ra\x03\xae\x01\x10\x10"}, {"debug/buildinfo", "\x03W\x02\x01\x01\b\a\x03`\x19\x02\x01*\x0f "},
{"debug/buildinfo", "\x03X\x02\x01\x01\b\a\x03`\x18\x02\x01+\x10\x1e"}, {"debug/dwarf", "\x03c\a\x03{0\x13\x01\x01"},
{"debug/dwarf", "\x03d\a\x03z1\x12\x01\x01"}, {"debug/elf", "\x03\x06P\r\a\x03`\x1a\x01+\x19\x01\x15"},
{"debug/elf", "\x03\x06Q\r\a\x03`\x19\x01,\x18\x01\x15"}, {"debug/gosym", "\x03c\n\xbe\x01\x01\x01\x02"},
{"debug/gosym", "\x03d\n\xbd\x01\x01\x01\x02"}, {"debug/macho", "\x03\x06P\r\n`\x1b+\x19\x01"},
{"debug/macho", "\x03\x06Q\r\n`\x1a,\x18\x01"}, {"debug/pe", "\x03\x06P\r\a\x03`\x1b+\x19\x01\x15"},
{"debug/pe", "\x03\x06Q\r\a\x03`\x1a,\x18\x01\x15"}, {"debug/plan9obj", "f\a\x03`\x1b+"},
{"debug/plan9obj", "g\a\x03`\x1a,"}, {"embed", "m+:\x19\x01S"},
{"embed", "n+:\x18\x01S"},
{"embed/internal/embedtest", ""}, {"embed/internal/embedtest", ""},
{"encoding", ""}, {"encoding", ""},
{"encoding/ascii85", "\xeb\x01D"}, {"encoding/ascii85", "\xeb\x01D"},
{"encoding/asn1", "\x03k\x03\x87\x01\x01&\x0e\x02\x01\x0f\x03\x01"}, {"encoding/asn1", "\x03j\x03\x88\x01\x01%\x0f\x02\x01\x0f\x03\x01"},
{"encoding/base32", "\xeb\x01B\x02"}, {"encoding/base32", "\xeb\x01B\x02"},
{"encoding/base64", "\x9a\x01QB\x02"}, {"encoding/base64", "f\x85\x01B\x02"},
{"encoding/binary", "n}\r'\x0e\x05"}, {"encoding/binary", "m~\r&\x0f\x05"},
{"encoding/csv", "\x02\x01k\x03zE\x11\x02"}, {"encoding/csv", "\x02\x01j\x03{E\x11\x02"},
{"encoding/gob", "\x02`\x05\a\x03`\x1a\f\x01\x02\x1d\b\x13\x01\x0e\x02"}, {"encoding/gob", "\x02_\x05\a\x03`\x1b\f\x01\x02\x1c\b\x14\x01\x0e\x02"},
{"encoding/hex", "n\x03zB\x03"}, {"encoding/hex", "m\x03{B\x03"},
{"encoding/json", "\x03\x01^\x04\b\x03z\r'\x0e\x02\x01\x02\x0f\x01\x01\x02"}, {"encoding/json", "\x03\x01]\x04\b\x03{\r&\x0f\x02\x01\x02\x0f\x01\x01\x02"},
{"encoding/pem", "\x03c\b}B\x03"}, {"encoding/pem", "\x03b\b~B\x03"},
{"encoding/xml", "\x02\x01_\f\x03z4\x05\v\x01\x02\x0f\x02"}, {"encoding/xml", "\x02\x01^\f\x03{3\x05\f\x01\x02\x0f\x02"},
{"errors", "\xca\x01{"}, {"errors", "\xc9\x01|"},
{"expvar", "kK9\t\n\x15\r\t\x02\x03\x01\x10"}, {"expvar", "jK:\t\n\x14\r\n\x02\x03\x01\x10"},
{"flag", "b\f\x03z,\b\x05\t\x02\x01\x0f"}, {"flag", "a\f\x03{+\b\x05\n\x02\x01\x0f"},
{"fmt", "nE8\r\x1f\b\x0e\x02\x03\x11"}, {"fmt", "mE9\r\x1e\b\x0f\x02\x03\x11"},
{"go/ast", "\x03\x01m\x0f\x01j\x03)\b\x0e\x02\x01"}, {"go/ast", "\x03\x01l\x0f\x01k\x03(\b\x0f\x02\x01"},
{"go/ast/internal/tests", ""}, {"go/ast/internal/tests", ""},
{"go/build", "\x02\x01k\x03\x01\x03\x02\a\x02\x01\x17\x1e\x04\x02\t\x14\x12\x01+\x01\x04\x01\a\t\x02\x01\x11\x02\x02"}, {"go/build", "\x02\x01j\x03\x01\x03\x02\a\x02\x01\x17\x1e\x04\x02\t\x14\x13\x01*\x01\x04\x01\a\n\x02\x01\x11\x02\x02"},
{"go/build/constraint", "n\xc1\x01\x01\x11\x02"}, {"go/build/constraint", "m\xc2\x01\x01\x11\x02"},
{"go/constant", "q\x10w\x01\x015\x01\x02\x11"}, {"go/constant", "p\x10x\x01\x015\x01\x02\x11"},
{"go/doc", "\x04m\x01\x06\t=-1\x11\x02\x01\x11\x02"}, {"go/doc", "\x04l\x01\x06\t=.0\x12\x02\x01\x11\x02"},
{"go/doc/comment", "\x03n\xbc\x01\x01\x01\x01\x11\x02"}, {"go/doc/comment", "\x03m\xbd\x01\x01\x01\x01\x11\x02"},
{"go/format", "\x03n\x01\f\x01\x02jE"}, {"go/format", "\x03m\x01\f\x01\x02kE"},
{"go/importer", "t\a\x01\x01\x04\x01i9"}, {"go/importer", "s\a\x01\x01\x04\x01j8"},
{"go/internal/gccgoimporter", "\x02\x01X\x13\x03\x05\v\x01g\x02,\x01\x05\x12\x01\v\b"}, {"go/internal/gccgoimporter", "\x02\x01W\x13\x03\x05\v\x01h\x02+\x01\x05\x13\x01\v\b"},
{"go/internal/gcimporter", "\x02o\x10\x01/\x05\x0e',\x16\x03\x02"}, {"go/internal/gcimporter", "\x02n\x10\x01/\x05\x0e(+\x17\x03\x02"},
{"go/internal/srcimporter", "q\x01\x02\n\x03\x01i,\x01\x05\x13\x02\x13"}, {"go/internal/srcimporter", "p\x01\x02\n\x03\x01j+\x01\x05\x14\x02\x13"},
{"go/parser", "\x03k\x03\x01\x03\v\x01j\x01+\x06\x13"}, {"go/parser", "\x03j\x03\x01\x03\v\x01k\x01*\x06\x14"},
{"go/printer", "q\x01\x03\x03\tj\r\x1f\x16\x02\x01\x02\n\x05\x02"}, {"go/printer", "p\x01\x03\x03\tk\r\x1e\x17\x02\x01\x02\n\x05\x02"},
{"go/scanner", "\x03n\x10j2\x11\x01\x12\x02"}, {"go/scanner", "\x03m\x10k1\x12\x01\x12\x02"},
{"go/token", "\x04m\xbc\x01\x02\x03\x01\x0e\x02"}, {"go/token", "\x04l\xbd\x01\x02\x03\x01\x0e\x02"},
{"go/types", "\x03\x01\x06d\x03\x01\x04\b\x03\x02\x15\x1e\x06+\x04\x03\n%\a\t\x01\x01\x01\x02\x01\x0e\x02\x02"}, {"go/types", "\x03\x01\x06c\x03\x01\x04\b\x03\x02\x15\x1e\x06,\x04\x03\n$\a\n\x01\x01\x01\x02\x01\x0e\x02\x02"},
{"go/version", "\xbb\x01u"}, {"go/version", "\xba\x01v"},
{"hash", "\xeb\x01"}, {"hash", "\xeb\x01"},
{"hash/adler32", "n\x16\x16"}, {"hash/adler32", "m\x16\x16"},
{"hash/crc32", "n\x16\x16\x14\x84\x01\x01"}, {"hash/crc32", "m\x16\x16\x14\x85\x01\x01\x12"},
{"hash/crc64", "n\x16\x16\x98\x01"}, {"hash/crc64", "m\x16\x16\x99\x01"},
{"hash/fnv", "n\x16\x16`"}, {"hash/fnv", "m\x16\x16a"},
{"hash/maphash", "\x95\x01\x05\x1b\x03@M"}, {"hash/maphash", "\x94\x01\x05\x1b\x03AM"},
{"html", "\xb0\x02\x02\x11"}, {"html", "\xb0\x02\x02\x11"},
{"html/template", "\x03h\x06\x19,5\x01\v \x05\x01\x02\x03\r\x01\x02\v\x01\x03\x02"}, {"html/template", "\x03g\x06\x19,6\x01\v\x1f\x05\x01\x02\x03\x0e\x01\x02\v\x01\x03\x02"},
{"image", "\x02l\x1f^\x0f5\x03\x01"}, {"image", "\x02k\x1f_\x0f5\x03\x01"},
{"image/color", ""}, {"image/color", ""},
{"image/color/palette", "\x8d\x01"}, {"image/color/palette", "\x8c\x01"},
{"image/draw", "\x8c\x01\x01\x04"}, {"image/draw", "\x8b\x01\x01\x04"},
{"image/gif", "\x02\x01\x05f\x03\x1b\x01\x01\x01\vQ"}, {"image/gif", "\x02\x01\x05e\x03\x1b\x01\x01\x01\vR"},
{"image/internal/imageutil", "\x8c\x01"}, {"image/internal/imageutil", "\x8b\x01"},
{"image/jpeg", "\x02l\x1e\x01\x04Z"}, {"image/jpeg", "\x02k\x1e\x01\x04["},
{"image/png", "\x02\a^\n\x13\x02\x06\x01^D"}, {"image/png", "\x02\a]\n\x13\x02\x06\x01_D"},
{"index/suffixarray", "\x03d\a}\r*\v\x01"}, {"index/suffixarray", "\x03c\a~\r)\f\x01"},
{"internal/abi", "\xb5\x01\x90\x01"}, {"internal/abi", "\xb4\x01\x91\x01"},
{"internal/asan", "\xc5\x02"}, {"internal/asan", "\xc5\x02"},
{"internal/bisect", "\xa4\x02\x0e\x01"}, {"internal/bisect", "\xa3\x02\x0f\x01"},
{"internal/buildcfg", "qG_\x06\x02\x05\v\x01"}, {"internal/buildcfg", "pG_\x06\x02\x05\f\x01"},
{"internal/bytealg", "\xae\x01\x97\x01"}, {"internal/bytealg", "\xad\x01\x98\x01"},
{"internal/byteorder", ""}, {"internal/byteorder", ""},
{"internal/cfg", ""}, {"internal/cfg", ""},
{"internal/chacha8rand", "\x9a\x01\x1b\x90\x01"}, {"internal/chacha8rand", "\x99\x01\x1b\x91\x01"},
{"internal/copyright", ""}, {"internal/copyright", ""},
{"internal/coverage", ""}, {"internal/coverage", ""},
{"internal/coverage/calloc", ""}, {"internal/coverage/calloc", ""},
{"internal/coverage/cfile", "k\x06\x17\x16\x01\x02\x01\x01\x01\x01\x01\x01\x01$\x01\x1e,\x06\a\v\x01\x03\f\x06"}, {"internal/coverage/cfile", "j\x06\x17\x16\x01\x02\x01\x01\x01\x01\x01\x01\x01#\x01 +\x06\a\f\x01\x03\f\x06"},
{"internal/coverage/cformat", "\x04m-\x04I\f6\x01\x02\f"}, {"internal/coverage/cformat", "\x04l-\x04J\f6\x01\x02\f"},
{"internal/coverage/cmerge", "q-Z"}, {"internal/coverage/cmerge", "p-["},
{"internal/coverage/decodecounter", "g\n-\v\x02@,\x18\x16"}, {"internal/coverage/decodecounter", "f\n-\v\x02A+\x19\x16"},
{"internal/coverage/decodemeta", "\x02e\n\x17\x16\v\x02@,"}, {"internal/coverage/decodemeta", "\x02d\n\x17\x16\v\x02A+"},
{"internal/coverage/encodecounter", "\x02e\n-\f\x01\x02>\f \x16"}, {"internal/coverage/encodecounter", "\x02d\n-\f\x01\x02?\f\x1f\x17"},
{"internal/coverage/encodemeta", "\x02\x01d\n\x13\x04\x16\r\x02>,."}, {"internal/coverage/encodemeta", "\x02\x01c\n\x13\x04\x16\r\x02?+/"},
{"internal/coverage/pods", "\x04m-y\x06\x05\v\x02\x01"}, {"internal/coverage/pods", "\x04l-y\x06\x05\f\x02\x01"},
{"internal/coverage/rtcov", "\xc5\x02"}, {"internal/coverage/rtcov", "\xc5\x02"},
{"internal/coverage/slicereader", "g\nzZ"}, {"internal/coverage/slicereader", "f\n{Z"},
{"internal/coverage/slicewriter", "qz"}, {"internal/coverage/slicewriter", "p{"},
{"internal/coverage/stringtab", "q8\x04>"}, {"internal/coverage/stringtab", "p8\x04?"},
{"internal/coverage/test", ""}, {"internal/coverage/test", ""},
{"internal/coverage/uleb128", ""}, {"internal/coverage/uleb128", ""},
{"internal/cpu", "\xc5\x02"}, {"internal/cpu", "\xc5\x02"},
{"internal/dag", "\x04m\xbc\x01\x03"}, {"internal/dag", "\x04l\xbd\x01\x03"},
{"internal/diff", "\x03n\xbd\x01\x02"}, {"internal/diff", "\x03m\xbe\x01\x02"},
{"internal/exportdata", "\x02\x01k\x03\x03]\x1a,\x01\x05\x12\x01\x02"}, {"internal/exportdata", "\x02\x01j\x03\x03]\x1b+\x01\x05\x13\x01\x02"},
{"internal/filepathlite", "n+:\x19A"}, {"internal/filepathlite", "m+:\x1aA"},
{"internal/fmtsort", "\x04\x9b\x02\x0e"}, {"internal/fmtsort", "\x04\x9a\x02\x0f"},
{"internal/fuzz", "\x03\nA\x19\x04\x03\x03\x01\f\x0355\r\x02\x1d\x01\x05\x02\x05\v\x01\x02\x01\x01\v\x04\x02"}, {"internal/fuzz", "\x03\nA\x18\x04\x03\x03\x01\f\x0356\r\x02\x1c\x01\x05\x02\x05\f\x01\x02\x01\x01\v\x04\x02"},
{"internal/goarch", ""}, {"internal/goarch", ""},
{"internal/godebug", "\x97\x01 {\x01\x12"}, {"internal/godebug", "\x96\x01 |\x01\x12"},
{"internal/godebugs", ""}, {"internal/godebugs", ""},
{"internal/goexperiment", ""}, {"internal/goexperiment", ""},
{"internal/goos", ""}, {"internal/goos", ""},
{"internal/goroot", "\x97\x02\x01\x05\x13\x02"}, {"internal/goroot", "\x96\x02\x01\x05\x14\x02"},
{"internal/gover", "\x04"}, {"internal/gover", "\x04"},
{"internal/goversion", ""}, {"internal/goversion", ""},
{"internal/itoa", ""}, {"internal/itoa", ""},
{"internal/lazyregexp", "\x97\x02\v\x0e\x02"}, {"internal/lazyregexp", "\x96\x02\v\x0f\x02"},
{"internal/lazytemplate", "\xeb\x01,\x19\x02\v"}, {"internal/lazytemplate", "\xeb\x01+\x1a\x02\v"},
{"internal/msan", "\xc5\x02"}, {"internal/msan", "\xc5\x02"},
{"internal/nettrace", ""}, {"internal/nettrace", ""},
{"internal/obscuretestdata", "f\x85\x01,"}, {"internal/obscuretestdata", "e\x86\x01+"},
{"internal/oserror", "n"}, {"internal/oserror", "m"},
{"internal/pkgbits", "\x03K\x19\a\x03\x05\vj\x0e\x1e\r\v\x01"}, {"internal/pkgbits", "\x03K\x18\a\x03\x05\vk\x0e\x1d\r\f\x01"},
{"internal/platform", ""}, {"internal/platform", ""},
{"internal/poll", "nO\x1a\x149\x0e\x01\x01\v\x06"}, {"internal/poll", "mO\x1a\x158\x0f\x01\x01\v\x06"},
{"internal/profile", "\x03\x04g\x03z7\f\x01\x01\x0f"}, {"internal/profile", "\x03\x04f\x03{6\r\x01\x01\x0f"},
{"internal/profilerecord", ""}, {"internal/profilerecord", ""},
{"internal/race", "\x95\x01\xb0\x01"}, {"internal/race", "\x94\x01\xb1\x01"},
{"internal/reflectlite", "\x95\x01 3<!"}, {"internal/reflectlite", "\x94\x01 4;\""},
{"internal/routebsd", "n,w\x13\x10\x11"}, {"internal/runtime/atomic", "\xc5\x02"},
{"internal/runtime/atomic", "\xae\x01\x97\x01"}, {"internal/runtime/exithook", "\xca\x01{"},
{"internal/runtime/exithook", "\xcc\x01y"}, {"internal/runtime/maps", "\x94\x01\x01\x1f\v\t\x05\x01w"},
{"internal/runtime/maps", "\x95\x01\x01\x1f\v\t\x06\x01u"}, {"internal/runtime/math", "\xb4\x01"},
{"internal/runtime/math", "\xb5\x01"}, {"internal/runtime/sys", "\xb4\x01\x04"},
{"internal/runtime/sys", "\xae\x01\a\x04"}, {"internal/runtime/syscall", "\xc5\x02"},
{"internal/saferio", "\xeb\x01Z"}, {"internal/saferio", "\xeb\x01Z"},
{"internal/singleflight", "\xb2\x02"}, {"internal/singleflight", "\xb2\x02"},
{"internal/stringslite", "\x99\x01\xac\x01"}, {"internal/stringslite", "\x98\x01\xad\x01"},
{"internal/sync", "\x95\x01 \x14j\x12"}, {"internal/sync", "\x94\x01 \x14k\x12"},
{"internal/synctest", "\xc5\x02"}, {"internal/synctest", "\xc5\x02"},
{"internal/syscall/execenv", "\xb4\x02"}, {"internal/syscall/execenv", "\xb4\x02"},
{"internal/syscall/unix", "\x95\x01\x8f\x01\x10\x11"}, {"internal/syscall/unix", "\xa3\x02\x10\x01\x11"},
{"internal/sysinfo", "\xae\x01\x84\x01\x02"}, {"internal/sysinfo", "\x02\x01\xaa\x01>+\x1a\x02"},
{"internal/syslist", ""}, {"internal/syslist", ""},
{"internal/testenv", "\x03\na\x02\x01*\x1a\x10'+\x01\x05\a\v\x01\x02\x02\x01\n"}, {"internal/testenv", "\x03\n`\x02\x01*\x1a\x10(*\x01\x05\a\f\x01\x02\x02\x01\n"},
{"internal/testlog", "\xb2\x02\x01\x12"}, {"internal/testlog", "\xb2\x02\x01\x12"},
{"internal/testpty", "n\x03f@\x1d"}, {"internal/testpty", "m\x03\xa6\x01"},
{"internal/trace", "\x02\x01\x01\x06]\a\x03n\x03\x03\x06\x03\n5\x01\x02\x0f\x06"}, {"internal/trace", "\x02\x01\x01\x06\\\a\x03m\x01\x01\x06\x06\x03\n5\x01\x02\x0f"},
{"internal/trace/internal/testgen", "\x03d\nl\x03\x02\x03\x011\v\x0e"}, {"internal/trace/event", ""},
{"internal/trace/internal/tracev1", "\x03\x01c\a\x03t\x06\r5\x01"}, {"internal/trace/event/go122", "pm"},
{"internal/trace/raw", "\x02e\nq\x03\x06D\x01\x11"}, {"internal/trace/internal/oldtrace", "\x03\x01b\a\x03m\b\x06\r5\x01"},
{"internal/trace/testtrace", "\x02\x01k\x03l\x03\x06\x057\v\x02\x01"}, {"internal/trace/internal/testgen/go122", "\x03c\nl\x01\x01\x03\x04\x010\v\x0f"},
{"internal/trace/tracev2", ""}, {"internal/trace/raw", "\x02d\nm\b\x06D\x01\x11"},
{"internal/trace/traceviewer", "\x02^\v\x06\x1a<\x16\a\a\x04\t\n\x15\x01\x05\a\v\x01\x02\r"}, {"internal/trace/testtrace", "\x02\x01j\x03l\x05\x05\x056\f\x02\x01"},
{"internal/trace/traceviewer", "\x02]\v\x06\x1a<\x16\b\a\x04\t\n\x14\x01\x05\a\f\x01\x02\r"},
{"internal/trace/traceviewer/format", ""}, {"internal/trace/traceviewer/format", ""},
{"internal/trace/version", "qq\t"}, {"internal/trace/version", "pm\x01\r"},
{"internal/txtar", "\x03n\xa6\x01\x19"}, {"internal/txtar", "\x03m\xa6\x01\x1a"},
{"internal/types/errors", "\xaf\x02"}, {"internal/types/errors", "\xaf\x02"},
{"internal/unsafeheader", "\xc5\x02"}, {"internal/unsafeheader", "\xc5\x02"},
{"internal/xcoff", "Z\r\a\x03`\x1a,\x18\x01"}, {"internal/xcoff", "Y\r\a\x03`\x1b+\x19\x01"},
{"internal/zstd", "g\a\x03z\x0f"}, {"internal/zstd", "f\a\x03{\x0f"},
{"io", "n\xc4\x01"}, {"io", "m\xc5\x01"},
{"io/fs", "n+*(1\x11\x12\x04"}, {"io/fs", "m+*)0\x12\x12\x04"},
{"io/ioutil", "\xeb\x01\x01+\x16\x03"}, {"io/ioutil", "\xeb\x01\x01*\x17\x03"},
{"iter", "\xc9\x01[!"}, {"iter", "\xc8\x01[\""},
{"log", "qz\x05'\r\x0e\x01\f"}, {"log", "p{\x05&\r\x0f\x01\f"},
{"log/internal", ""}, {"log/internal", ""},
{"log/slog", "\x03\nU\t\x03\x03z\x04\x01\x02\x02\x04'\x05\t\x02\x01\x02\x01\f\x02\x02\x02"}, {"log/slog", "\x03\nT\t\x03\x03{\x04\x01\x02\x02\x04&\x05\n\x02\x01\x02\x01\f\x02\x02\x02"},
{"log/slog/internal", ""}, {"log/slog/internal", ""},
{"log/slog/internal/benchmarks", "\ra\x03z\x06\x03;\x10"}, {"log/slog/internal/benchmarks", "\r`\x03{\x06\x03;\x10"},
{"log/slog/internal/buffer", "\xb2\x02"}, {"log/slog/internal/buffer", "\xb2\x02"},
{"log/slog/internal/slogtest", "\xf1\x01"}, {"log/slog/internal/slogtest", "\xf1\x01"},
{"log/syslog", "n\x03~\x12\x16\x19\x02\r"}, {"log/syslog", "m\x03\x7f\x12\x15\x1a\x02\r"},
{"maps", "\xee\x01W"}, {"maps", "\xee\x01W"},
{"math", "\xfa\x01K"}, {"math", "\xad\x01MK"},
{"math/big", "\x03k\x03)Q\r\x02\x021\x02\x01\x02\x13"}, {"math/big", "\x03j\x03)\x14>\r\x02\x023\x01\x02\x13"},
{"math/bits", "\xc5\x02"}, {"math/bits", "\xc5\x02"},
{"math/cmplx", "\xf8\x01\x02"}, {"math/cmplx", "\xf8\x01\x02"},
{"math/rand", "\xb6\x01B:\x01\x12"}, {"math/rand", "\xb5\x01C:\x01\x12"},
{"math/rand/v2", "n,\x02\\\x02K"}, {"math/rand/v2", "m,\x02]\x02K"},
{"mime", "\x02\x01c\b\x03z\f \x16\x03\x02\x0f\x02"}, {"mime", "\x02\x01b\b\x03{\f\x1f\x17\x03\x02\x0f\x02"},
{"mime/multipart", "\x02\x01G$\x03E5\f\x01\x06\x02\x15\x02\x06\x10\x02\x01\x15"}, {"mime/multipart", "\x02\x01G#\x03E6\f\x01\x06\x02\x14\x02\x06\x11\x02\x01\x15"},
{"mime/quotedprintable", "\x02\x01nz"}, {"mime/quotedprintable", "\x02\x01m{"},
{"net", "\x04\ta+\x1d\a\x04\x05\x05\a\x01\x04\x14\x01%\x06\r\t\x05\x01\x01\v\x06\a"}, {"net", "\x04\t`+\x1d\a\x04\x05\f\x01\x04\x15\x01$\x06\r\n\x05\x01\x01\v\x06\a"},
{"net/http", "\x02\x01\x04\x04\x02=\b\x14\x01\a\x03E5\x01\x03\b\x01\x02\x02\x02\x01\x02\x06\x02\x01\x01\n\x01\x01\x05\x01\x02\x05\t\x01\x01\x01\x02\x01\f\x02\x02\x02\b\x01\x01\x01"}, {"net/http", "\x02\x01\x04\x04\x02=\b\x13\x01\a\x03E6\x01\x03\b\x01\x02\x02\x02\x01\x02\x06\x02\x01\n\x01\x01\x05\x01\x02\x05\n\x01\x01\x01\x02\x01\f\x02\x02\x02\b\x01\x01\x01"},
{"net/http/cgi", "\x02P\x1c\x03z\x04\b\n\x01\x13\x01\x01\x01\x04\x01\x05\x02\t\x02\x01\x0f\x0e"}, {"net/http/cgi", "\x02P\x1b\x03{\x04\b\n\x01\x12\x01\x01\x01\x04\x01\x05\x02\n\x02\x01\x0f\x0e"},
{"net/http/cookiejar", "\x04j\x03\x90\x01\x01\b\f\x17\x03\x02\r\x04"}, {"net/http/cookiejar", "\x04i\x03\x91\x01\x01\b\v\x18\x03\x02\r\x04"},
{"net/http/fcgi", "\x02\x01\nZ\a\x03z\x16\x01\x01\x14\x19\x02\r"}, {"net/http/fcgi", "\x02\x01\nY\a\x03{\x16\x01\x01\x13\x1a\x02\r"},
{"net/http/httptest", "\x02\x01\nE\x02\x1c\x01z\x04\x12\x01\n\t\x02\x18\x01\x02\r\x0e"}, {"net/http/httptest", "\x02\x01\nE\x02\x1b\x01{\x04\x12\x01\t\t\x02\x19\x01\x02\r\x0e"},
{"net/http/httptrace", "\rEo@\x14\n "}, {"net/http/httptrace", "\rEnA\x13\n!"},
{"net/http/httputil", "\x02\x01\na\x03z\x04\x0f\x03\x01\x05\x02\x01\v\x01\x1a\x02\r\x0e"}, {"net/http/httputil", "\x02\x01\n`\x03{\x04\x0f\x03\x01\x05\x02\x01\n\x01\x1b\x02\r\x0e"},
{"net/http/internal", "\x02\x01k\x03z"}, {"net/http/internal", "\x02\x01j\x03{"},
{"net/http/internal/ascii", "\xb0\x02\x11"}, {"net/http/internal/ascii", "\xb0\x02\x11"},
{"net/http/internal/httpcommon", "\ra\x03\x96\x01\x0e\x01\x18\x01\x01\x02\x1b\x02"},
{"net/http/internal/testcert", "\xb0\x02"}, {"net/http/internal/testcert", "\xb0\x02"},
{"net/http/pprof", "\x02\x01\nd\x19,\x11$\x04\x13\x14\x01\r\x06\x02\x01\x02\x01\x0f"}, {"net/http/pprof", "\x02\x01\nc\x19,\x11%\x04\x13\x13\x01\r\x06\x03\x01\x02\x01\x0f"},
{"net/internal/cgotest", "\xd7\x01n"}, {"net/internal/cgotest", ""},
{"net/internal/socktest", "q\xc1\x01\x02"}, {"net/internal/socktest", "p\xc2\x01\x02"},
{"net/mail", "\x02l\x03z\x04\x0f\x03\x14\x1b\x02\r\x04"}, {"net/mail", "\x02k\x03{\x04\x0f\x03\x13\x1c\x02\r\x04"},
{"net/netip", "\x04j+\x01#;\x025\x15"}, {"net/netip", "\x04i+\x01#<\x025\x15"},
{"net/rpc", "\x02g\x05\x03\x10\n`\x04\x12\x01\x1d\x0e\x03\x02"}, {"net/rpc", "\x02f\x05\x03\x10\na\x04\x12\x01\x1c\x0f\x03\x02"},
{"net/rpc/jsonrpc", "k\x03\x03z\x16\x11 "}, {"net/rpc/jsonrpc", "j\x03\x03{\x16\x10!"},
{"net/smtp", "\x19.\v\x14\b\x03z\x16\x14\x1b"}, {"net/smtp", "\x19.\v\x13\b\x03{\x16\x13\x1c"},
{"net/textproto", "\x02\x01k\x03z\r\t.\x01\x02\x13"}, {"net/textproto", "\x02\x01j\x03{\r\t.\x01\x02\x13"},
{"net/url", "n\x03\x86\x01%\x11\x02\x01\x15"}, {"net/url", "m\x03\x87\x01$\x12\x02\x01\x15"},
{"os", "n+\x19\v\t\r\x03\x01\x04\x10\x018\t\x05\x01\x01\v\x06"}, {"os", "m+\x01\x18\x03\b\t\r\x03\x01\x04\x11\x017\n\x05\x01\x01\v\x06"},
{"os/exec", "\x03\naH \x01\x14\x01+\x06\a\v\x01\x04\v"}, {"os/exec", "\x03\n`H \x01\x15\x01*\x06\a\f\x01\x04\v"},
{"os/exec/internal/fdtest", "\xb4\x02"}, {"os/exec/internal/fdtest", "\xb4\x02"},
{"os/signal", "\r\x8a\x02\x16\x05\x02"}, {"os/signal", "\r\x89\x02\x17\x05\x02"},
{"os/user", "qfM\v\x01\x02\x02\x11"}, {"os/user", "\x02\x01j\x03{+\r\f\x01\x02"},
{"path", "n+\xaa\x01"}, {"path", "m+\xab\x01"},
{"path/filepath", "n+\x19:+\r\t\x03\x04\x0f"}, {"path/filepath", "m+\x19;*\r\n\x03\x04\x0f"},
{"plugin", "n\xc4\x01\x13"}, {"plugin", "m"},
{"reflect", "n'\x04\x1c\b\f\x05\x02\x18\x06\n,\v\x03\x0f\x02\x02"}, {"reflect", "m'\x04\x1c\b\f\x04\x02\x1a\x06\n+\f\x03\x0f\x02\x02"},
{"reflect/internal/example1", ""}, {"reflect/internal/example1", ""},
{"reflect/internal/example2", ""}, {"reflect/internal/example2", ""},
{"regexp", "\x03\xe8\x018\n\x02\x01\x02\x0f\x02"}, {"regexp", "\x03\xe8\x017\v\x02\x01\x02\x0f\x02"},
{"regexp/syntax", "\xad\x02\x01\x01\x01\x11\x02"}, {"regexp/syntax", "\xad\x02\x01\x01\x01\x11\x02"},
{"runtime", "\x95\x01\x04\x01\x02\f\x06\a\x02\x01\x01\x0f\x04\x01\x01\x01\x01\x03\x0fc"}, {"runtime", "\x94\x01\x04\x01\x02\f\x06\a\x02\x01\x01\x0f\x03\x01\x01\x01\x01\x01\x03s"},
{"runtime/cgo", "\xd0\x01b\x01\x12"}, {"runtime/coverage", "\x9f\x01L"},
{"runtime/coverage", "\xa0\x01K"}, {"runtime/debug", "pUQ\r\n\x02\x01\x0f\x06"},
{"runtime/debug", "qUQ\r\t\x02\x01\x0f\x06"}, {"runtime/internal/startlinetest", ""},
{"runtime/internal/wasitest", ""}, {"runtime/internal/wasitest", ""},
{"runtime/metrics", "\xb7\x01A,!"}, {"runtime/metrics", "\xb6\x01B+\""},
{"runtime/pprof", "\x02\x01\x01\x03\x06Z\a\x03$3#\r\x1f\r\t\x01\x01\x01\x02\x02\b\x03\x06"}, {"runtime/pprof", "\x02\x01\x01\x03\x06Y\a\x03$3$\r\x1e\r\n\x01\x01\x01\x02\x02\b\x03\x06"},
{"runtime/race", ""}, {"runtime/race", "\xab\x02"},
{"runtime/trace", "\rdz9\x0e\x01\x12"}, {"runtime/race/internal/amd64v1", ""},
{"runtime/trace", "\rc{8\x0f\x01\x12"},
{"slices", "\x04\xea\x01\fK"}, {"slices", "\x04\xea\x01\fK"},
{"sort", "\xca\x0103"}, {"sort", "\xc9\x0113"},
{"strconv", "n+:%\x02I"}, {"strconv", "m+:&\x02I"},
{"strings", "n'\x04:\x18\x03\f8\x0f\x02\x02"}, {"strings", "m'\x04:\x19\x03\f8\x0f\x02\x02"},
{"structs", ""}, {"structs", ""},
{"sync", "\xc9\x01\vP\x0f\x12"}, {"sync", "\xc8\x01\vP\x10\x12"},
{"sync/atomic", "\xc5\x02"}, {"sync/atomic", "\xc5\x02"},
{"syscall", "n'\x01\x03\x01\x1b\b\x03\x03\x06[\x0e\x01\x12"}, {"syscall", "m(\x03\x01\x1b\b\x03\x03\x06\aT\x0f\x01\x12"},
{"testing", "\x03\na\x02\x01X\x0f\x13\r\x04\x1b\x06\x02\x05\x03\x05\x01\x02\x01\x02\x01\f\x02\x02\x02"}, {"testing", "\x03\n`\x02\x01G\x11\x0f\x14\r\x04\x1a\x06\x02\x05\x02\a\x01\x02\x01\x02\x01\f\x02\x02\x02"},
{"testing/fstest", "n\x03z\x01\v%\x11\x03\b\a"}, {"testing/fstest", "m\x03{\x01\v$\x12\x03\b\a"},
{"testing/internal/testdeps", "\x02\v\xa7\x01'\x10,\x03\x05\x03\b\x06\x02\r"}, {"testing/internal/testdeps", "\x02\v\xa6\x01'\x11+\x03\x05\x03\b\a\x02\r"},
{"testing/iotest", "\x03k\x03z\x04"}, {"testing/iotest", "\x03j\x03{\x04"},
{"testing/quick", "p\x01\x87\x01\x04#\x11\x0f"}, {"testing/quick", "o\x01\x88\x01\x04\"\x12\x0f"},
{"testing/slogtest", "\ra\x03\x80\x01.\x05\x11\n"}, {"testing/slogtest", "\r`\x03\x81\x01-\x05\x12\n"},
{"text/scanner", "\x03nz,*\x02"}, {"text/scanner", "\x03m{++\x02"},
{"text/tabwriter", "qzX"}, {"text/tabwriter", "p{X"},
{"text/template", "n\x03B8\x01\v\x1f\x01\x05\x01\x02\x05\f\x02\f\x03\x02"}, {"text/template", "m\x03B9\x01\v\x1e\x01\x05\x01\x02\x05\r\x02\f\x03\x02"},
{"text/template/parse", "\x03n\xb3\x01\v\x01\x11\x02"}, {"text/template/parse", "\x03m\xb3\x01\f\x01\x11\x02"},
{"time", "n+\x1d\x1d'*\x0e\x02\x11"}, {"time", "m+\x1d\x1d()\x0f\x02\x11"},
{"time/tzdata", "n\xc6\x01\x11"}, {"time/tzdata", "m\xc7\x01\x11"},
{"unicode", ""}, {"unicode", ""},
{"unicode/utf16", ""}, {"unicode/utf16", ""},
{"unicode/utf8", ""}, {"unicode/utf8", ""},
{"unique", "\x95\x01>\x01P\x0e\x13\x12"}, {"unique", "\x94\x01>\x01P\x0f\x13\x12"},
{"unsafe", ""}, {"unsafe", ""},
{"vendor/golang.org/x/crypto/chacha20", "\x10W\a\x8c\x01*&"}, {"vendor/golang.org/x/crypto/chacha20", "\x10V\a\x8d\x01)'"},
{"vendor/golang.org/x/crypto/chacha20poly1305", "\x10W\a\xd8\x01\x04\x01"}, {"vendor/golang.org/x/crypto/chacha20poly1305", "\x10V\a\xd9\x01\x04\x01\a"},
{"vendor/golang.org/x/crypto/cryptobyte", "d\n\x03\x88\x01& \n"}, {"vendor/golang.org/x/crypto/cryptobyte", "c\n\x03\x89\x01%!\n"},
{"vendor/golang.org/x/crypto/cryptobyte/asn1", ""}, {"vendor/golang.org/x/crypto/cryptobyte/asn1", ""},
{"vendor/golang.org/x/crypto/internal/alias", "\xc5\x02"}, {"vendor/golang.org/x/crypto/internal/alias", "\xc5\x02"},
{"vendor/golang.org/x/crypto/internal/poly1305", "Q\x16\x93\x01"}, {"vendor/golang.org/x/crypto/internal/poly1305", "Q\x15\x94\x01"},
{"vendor/golang.org/x/net/dns/dnsmessage", "n"}, {"vendor/golang.org/x/net/dns/dnsmessage", "m"},
{"vendor/golang.org/x/net/http/httpguts", "\x81\x02\x14\x1b\x13\r"}, {"vendor/golang.org/x/net/http/httpguts", "\x81\x02\x13\x1c\x13\r"},
{"vendor/golang.org/x/net/http/httpproxy", "n\x03\x90\x01\x15\x01\x19\x13\r"}, {"vendor/golang.org/x/net/http/httpproxy", "m\x03\x91\x01\x0f\x05\x01\x1a\x13\r"},
{"vendor/golang.org/x/net/http2/hpack", "\x03k\x03zG"}, {"vendor/golang.org/x/net/http2/hpack", "\x03j\x03{G"},
{"vendor/golang.org/x/net/idna", "q\x87\x018\x13\x10\x02\x01"}, {"vendor/golang.org/x/net/idna", "p\x88\x018\x13\x10\x02\x01"},
{"vendor/golang.org/x/net/nettest", "\x03d\a\x03z\x11\x05\x16\x01\f\v\x01\x02\x02\x01\n"}, {"vendor/golang.org/x/net/nettest", "\x03c\a\x03{\x11\x05\x15\x01\f\f\x01\x02\x02\x01\n"},
{"vendor/golang.org/x/sys/cpu", "\x97\x02\r\v\x01\x15"}, {"vendor/golang.org/x/sys/cpu", "\x96\x02\r\f\x01\x15"},
{"vendor/golang.org/x/text/secure/bidirule", "n\xd5\x01\x11\x01"}, {"vendor/golang.org/x/text/secure/bidirule", "m\xd6\x01\x11\x01"},
{"vendor/golang.org/x/text/transform", "\x03k}X"}, {"vendor/golang.org/x/text/transform", "\x03j~X"},
{"vendor/golang.org/x/text/unicode/bidi", "\x03\bf~?\x15"}, {"vendor/golang.org/x/text/unicode/bidi", "\x03\be\x7f?\x15"},
{"vendor/golang.org/x/text/unicode/norm", "g\nzG\x11\x11"}, {"vendor/golang.org/x/text/unicode/norm", "f\n{G\x11\x11"},
{"weak", "\x95\x01\x8f\x01!"}, {"weak", "\x94\x01\x8f\x01\""},
} }

View File

@ -7119,7 +7119,6 @@ var PackageSymbols = map[string][]Symbol{
{"FormatFileInfo", Func, 21}, {"FormatFileInfo", Func, 21},
{"Glob", Func, 16}, {"Glob", Func, 16},
{"GlobFS", Type, 16}, {"GlobFS", Type, 16},
{"Lstat", Func, 25},
{"ModeAppend", Const, 16}, {"ModeAppend", Const, 16},
{"ModeCharDevice", Const, 16}, {"ModeCharDevice", Const, 16},
{"ModeDevice", Const, 16}, {"ModeDevice", Const, 16},
@ -7144,8 +7143,6 @@ var PackageSymbols = map[string][]Symbol{
{"ReadDirFile", Type, 16}, {"ReadDirFile", Type, 16},
{"ReadFile", Func, 16}, {"ReadFile", Func, 16},
{"ReadFileFS", Type, 16}, {"ReadFileFS", Type, 16},
{"ReadLink", Func, 25},
{"ReadLinkFS", Type, 25},
{"SkipAll", Var, 20}, {"SkipAll", Var, 20},
{"SkipDir", Var, 16}, {"SkipDir", Var, 16},
{"Stat", Func, 16}, {"Stat", Func, 16},
@ -9149,8 +9146,6 @@ var PackageSymbols = map[string][]Symbol{
{"(*ProcessState).SysUsage", Method, 0}, {"(*ProcessState).SysUsage", Method, 0},
{"(*ProcessState).SystemTime", Method, 0}, {"(*ProcessState).SystemTime", Method, 0},
{"(*ProcessState).UserTime", Method, 0}, {"(*ProcessState).UserTime", Method, 0},
{"(*Root).Chmod", Method, 25},
{"(*Root).Chown", Method, 25},
{"(*Root).Close", Method, 24}, {"(*Root).Close", Method, 24},
{"(*Root).Create", Method, 24}, {"(*Root).Create", Method, 24},
{"(*Root).FS", Method, 24}, {"(*Root).FS", Method, 24},
@ -16759,11 +16754,9 @@ var PackageSymbols = map[string][]Symbol{
}, },
"testing/fstest": { "testing/fstest": {
{"(MapFS).Glob", Method, 16}, {"(MapFS).Glob", Method, 16},
{"(MapFS).Lstat", Method, 25},
{"(MapFS).Open", Method, 16}, {"(MapFS).Open", Method, 16},
{"(MapFS).ReadDir", Method, 16}, {"(MapFS).ReadDir", Method, 16},
{"(MapFS).ReadFile", Method, 16}, {"(MapFS).ReadFile", Method, 16},
{"(MapFS).ReadLink", Method, 25},
{"(MapFS).Stat", Method, 16}, {"(MapFS).Stat", Method, 16},
{"(MapFS).Sub", Method, 16}, {"(MapFS).Sub", Method, 16},
{"MapFS", Type, 16}, {"MapFS", Type, 16},

View File

@ -70,7 +70,7 @@ func (w *Free) Has(typ types.Type) (res bool) {
case *types.Tuple: case *types.Tuple:
n := t.Len() n := t.Len()
for i := 0; i < n; i++ { for i := range n {
if w.Has(t.At(i).Type()) { if w.Has(t.At(i).Type()) {
return true return true
} }

View File

@ -1,3 +1,6 @@
// Code generated by "go test -run=Generate -write=all"; DO NOT EDIT.
// Source: ../../cmd/compile/internal/types2/termlist.go
// Copyright 2021 The Go Authors. All rights reserved. // Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.
@ -7,8 +10,8 @@
package typeparams package typeparams
import ( import (
"bytes"
"go/types" "go/types"
"strings"
) )
// A termlist represents the type set represented by the union // A termlist represents the type set represented by the union
@ -22,15 +25,18 @@ type termlist []*term
// It is in normal form. // It is in normal form.
var allTermlist = termlist{new(term)} var allTermlist = termlist{new(term)}
// termSep is the separator used between individual terms.
const termSep = " | "
// String prints the termlist exactly (without normalization). // String prints the termlist exactly (without normalization).
func (xl termlist) String() string { func (xl termlist) String() string {
if len(xl) == 0 { if len(xl) == 0 {
return "∅" return "∅"
} }
var buf bytes.Buffer var buf strings.Builder
for i, x := range xl { for i, x := range xl {
if i > 0 { if i > 0 {
buf.WriteString(" | ") buf.WriteString(termSep)
} }
buf.WriteString(x.String()) buf.WriteString(x.String())
} }

View File

@ -1,3 +1,6 @@
// Code generated by "go test -run=Generate -write=all"; DO NOT EDIT.
// Source: ../../cmd/compile/internal/types2/typeterm.go
// Copyright 2021 The Go Authors. All rights reserved. // Copyright 2021 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style // Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file. // license that can be found in the LICENSE file.

View File

@ -0,0 +1,135 @@
// Copyright 2018 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package typesinternal
import (
"fmt"
"go/ast"
"go/types"
_ "unsafe"
)
// CallKind describes the function position of an [*ast.CallExpr].
type CallKind int
const (
CallStatic CallKind = iota // static call to known function
CallInterface // dynamic call through an interface method
CallDynamic // dynamic call of a func value
CallBuiltin // call to a builtin function
CallConversion // a conversion (not a call)
)
var callKindNames = []string{
"CallStatic",
"CallInterface",
"CallDynamic",
"CallBuiltin",
"CallConversion",
}
func (k CallKind) String() string {
if i := int(k); i >= 0 && i < len(callKindNames) {
return callKindNames[i]
}
return fmt.Sprintf("typeutil.CallKind(%d)", k)
}
// ClassifyCall classifies the function position of a call expression ([*ast.CallExpr]).
// It distinguishes among true function calls, calls to builtins, and type conversions,
// and further classifies function calls as static calls (where the function is known),
// dynamic interface calls, and other dynamic calls.
//
// For the declarations:
//
// func f() {}
// func g[T any]() {}
// var v func()
// var s []func()
// type I interface { M() }
// var i I
//
// ClassifyCall returns the following:
//
// f() CallStatic
// g[int]() CallStatic
// i.M() CallInterface
// min(1, 2) CallBuiltin
// v() CallDynamic
// s[0]() CallDynamic
// int(x) CallConversion
// []byte("") CallConversion
func ClassifyCall(info *types.Info, call *ast.CallExpr) CallKind {
if info.Types == nil {
panic("ClassifyCall: info.Types is nil")
}
if info.Types[call.Fun].IsType() {
return CallConversion
}
obj := info.Uses[UsedIdent(info, call.Fun)]
// Classify the call by the type of the object, if any.
switch obj := obj.(type) {
case *types.Builtin:
return CallBuiltin
case *types.Func:
if interfaceMethod(obj) {
return CallInterface
}
return CallStatic
default:
return CallDynamic
}
}
// UsedIdent returns the identifier such that info.Uses[UsedIdent(info, e)]
// is the [types.Object] used by e, if any.
//
// If e is one of various forms of reference:
//
// f, c, v, T lexical reference
// pkg.X qualified identifier
// f[T] or pkg.F[K,V] instantiations of the above kinds
// expr.f field or method value selector
// T.f method expression selector
//
// UsedIdent returns the identifier whose is associated value in [types.Info.Uses]
// is the object to which it refers.
//
// For the declarations:
//
// func F[T any] {...}
// type I interface { M() }
// var (
// x int
// s struct { f int }
// a []int
// i I
// )
//
// UsedIdent returns the following:
//
// Expr UsedIdent
// x x
// s.f f
// F[int] F
// i.M M
// I.M M
// min min
// int int
// 1 nil
// a[0] nil
// []byte nil
//
// Note: if e is an instantiated function or method, UsedIdent returns
// the corresponding generic function or method on the generic type.
func UsedIdent(info *types.Info, e ast.Expr) *ast.Ident {
return usedIdent(info, e)
}
//go:linkname usedIdent golang.org/x/tools/go/types/typeutil.usedIdent
func usedIdent(info *types.Info, e ast.Expr) *ast.Ident
//go:linkname interfaceMethod golang.org/x/tools/go/types/typeutil.interfaceMethod
func interfaceMethod(f *types.Func) bool

View File

@ -7,6 +7,7 @@
package typesinternal package typesinternal
import ( import (
"go/ast"
"go/token" "go/token"
"go/types" "go/types"
"reflect" "reflect"
@ -127,3 +128,17 @@ func Origin(t NamedOrAlias) NamedOrAlias {
func IsPackageLevel(obj types.Object) bool { func IsPackageLevel(obj types.Object) bool {
return obj.Pkg() != nil && obj.Parent() == obj.Pkg().Scope() return obj.Pkg() != nil && obj.Parent() == obj.Pkg().Scope()
} }
// NewTypesInfo returns a *types.Info with all maps populated.
func NewTypesInfo() *types.Info {
return &types.Info{
Types: map[ast.Expr]types.TypeAndValue{},
Instances: map[*ast.Ident]types.Instance{},
Defs: map[*ast.Ident]types.Object{},
Uses: map[*ast.Ident]types.Object{},
Implicits: map[ast.Node]types.Object{},
Selections: map[*ast.SelectorExpr]*types.Selection{},
Scopes: map[ast.Node]*types.Scope{},
FileVersions: map[*ast.File]string{},
}
}

12
vendor/modules.txt vendored
View File

@ -67,7 +67,7 @@ github.com/russross/blackfriday/v2
# go.etcd.io/bbolt v1.3.11 # go.etcd.io/bbolt v1.3.11
## explicit; go 1.22 ## explicit; go 1.22
go.etcd.io/bbolt go.etcd.io/bbolt
# golang.org/x/crypto v0.36.0 # golang.org/x/crypto v0.37.0
## explicit; go 1.23.0 ## explicit; go 1.23.0
golang.org/x/crypto/acme golang.org/x/crypto/acme
golang.org/x/crypto/bcrypt golang.org/x/crypto/bcrypt
@ -80,7 +80,7 @@ golang.org/x/mod/internal/lazyregexp
golang.org/x/mod/modfile golang.org/x/mod/modfile
golang.org/x/mod/module golang.org/x/mod/module
golang.org/x/mod/semver golang.org/x/mod/semver
# golang.org/x/net v0.38.0 # golang.org/x/net v0.39.0
## explicit; go 1.23.0 ## explicit; go 1.23.0
golang.org/x/net/dns/dnsmessage golang.org/x/net/dns/dnsmessage
golang.org/x/net/html golang.org/x/net/html
@ -93,15 +93,15 @@ golang.org/x/net/internal/httpcommon
golang.org/x/net/internal/socks golang.org/x/net/internal/socks
golang.org/x/net/proxy golang.org/x/net/proxy
golang.org/x/net/websocket golang.org/x/net/websocket
# golang.org/x/sync v0.12.0 # golang.org/x/sync v0.13.0
## explicit; go 1.23.0 ## explicit; go 1.23.0
golang.org/x/sync/errgroup golang.org/x/sync/errgroup
# golang.org/x/sys v0.31.0 # golang.org/x/sys v0.32.0
## explicit; go 1.23.0 ## explicit; go 1.23.0
golang.org/x/sys/cpu golang.org/x/sys/cpu
golang.org/x/sys/unix golang.org/x/sys/unix
golang.org/x/sys/windows golang.org/x/sys/windows
# golang.org/x/text v0.23.0 # golang.org/x/text v0.24.0
## explicit; go 1.23.0 ## explicit; go 1.23.0
golang.org/x/text/cases golang.org/x/text/cases
golang.org/x/text/encoding golang.org/x/text/encoding
@ -127,7 +127,7 @@ golang.org/x/text/transform
golang.org/x/text/unicode/bidi golang.org/x/text/unicode/bidi
golang.org/x/text/unicode/norm golang.org/x/text/unicode/norm
golang.org/x/text/width golang.org/x/text/width
# golang.org/x/tools v0.31.0 # golang.org/x/tools v0.32.0
## explicit; go 1.23.0 ## explicit; go 1.23.0
golang.org/x/tools/go/gcexportdata golang.org/x/tools/go/gcexportdata
golang.org/x/tools/go/packages golang.org/x/tools/go/packages