require (
github.com/google/pprof v0.0.0-20230811205829-9131a7e9cc17
- golang.org/x/arch v0.4.0
- golang.org/x/mod v0.12.0
- golang.org/x/sync v0.3.0
- golang.org/x/sys v0.13.0
- golang.org/x/term v0.13.0
- golang.org/x/tools v0.13.1-0.20230920233436-f9b8da7b22be
+ golang.org/x/arch v0.5.1-0.20231011141335-a6bdeed49307
+ golang.org/x/mod v0.13.0
+ golang.org/x/sync v0.4.1-0.20231011140417-10739b037d36
+ golang.org/x/sys v0.13.1-0.20231011215430-1bfbee0e20e3
+ golang.org/x/term v0.13.1-0.20231011140651-6a610bc55bff
+ golang.org/x/tools v0.14.1-0.20231019165902-71f6a46884ab
)
require github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab // indirect
github.com/google/pprof v0.0.0-20230811205829-9131a7e9cc17/go.mod h1:Jh3hGz2jkYak8qXPD19ryItVnUgpgeqzdkY/D0EaeuA=
github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab h1:BA4a7pe6ZTd9F8kXETBoijjFJ/ntaa//1wiH9BZu4zU=
github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw=
-golang.org/x/arch v0.4.0 h1:A8WCeEWhLwPBKNbFi5Wv5UTCBx5zzubnXDlMOFAzFMc=
-golang.org/x/arch v0.4.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
-golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
-golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
-golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E=
-golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
-golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
-golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/term v0.13.0 h1:bb+I9cTfFazGW51MZqBVmZy7+JEJMouUHTUSKVQLBek=
-golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U=
-golang.org/x/tools v0.13.1-0.20230920233436-f9b8da7b22be h1:pQ7OzPwwqEo+kv+G51MKwvanbWTNL8gLxowlKZ4+/4s=
-golang.org/x/tools v0.13.1-0.20230920233436-f9b8da7b22be/go.mod h1:UT0HyK+PbVxjduiWXEYi1mODDynTaoTRHJox7q8FIKk=
+golang.org/x/arch v0.5.1-0.20231011141335-a6bdeed49307 h1:1nIbNxjxQ3+dss3xYMxayoIZONazUTg8/BENwc19sAQ=
+golang.org/x/arch v0.5.1-0.20231011141335-a6bdeed49307/go.mod h1:FEVrYAQjsQXMVJ1nsMoVVXPZg6p2JE2mx8psSWTDQys=
+golang.org/x/mod v0.13.0 h1:I/DsJXRlw/8l/0c24sM9yb0T4z9liZTduXvdAWYiysY=
+golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
+golang.org/x/sync v0.4.1-0.20231011140417-10739b037d36 h1:+lDu3sHZVY5Qqb7ynMbjaT4IsYicvoxypEOIE4aYlYE=
+golang.org/x/sync v0.4.1-0.20231011140417-10739b037d36/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
+golang.org/x/sys v0.13.1-0.20231011215430-1bfbee0e20e3 h1:G9se7UpoI67yWrFY0IIFGf6H3nwLLUZFDBCyOJwWeSc=
+golang.org/x/sys v0.13.1-0.20231011215430-1bfbee0e20e3/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/term v0.13.1-0.20231011140651-6a610bc55bff h1:4lCCwEX5qbLiqBk8cqIlwrDbmkzfggoqDXYLTU+jr30=
+golang.org/x/term v0.13.1-0.20231011140651-6a610bc55bff/go.mod h1:tfGnZ3a6ww9diaioGSzdPRgIfpk6Odt1UPXNhRcgfag=
+golang.org/x/tools v0.14.1-0.20231019165902-71f6a46884ab h1:wNyFWaRZ6iFNvDL/8TK0HF5x3mGttsqpXPuHeKN88G8=
+golang.org/x/tools v0.14.1-0.20231019165902-71f6a46884ab/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg=
// [r2, r0, ror #1] -> (R2)(R0@>1)
// inst [r2, -r0, ror #1] -> INST.U (R2)(R0@>1)
// input:
-// a memory operand
+//
+// a memory operand
+//
// return values:
-// corresponding memory operand in Plan 9 syntax
-// .W/.P/.U suffix
+//
+// corresponding memory operand in Plan 9 syntax
+// .W/.P/.U suffix
func memOpTrans(mem Mem) (string, string) {
suffix := ""
switch mem.Mode {
return result
}
-// Register with arrangement and index: <Vm>.<Ts>[<index>],
-// { <Vt>.B, <Vt2>.B }[<index>].
+// Register with arrangement and index:
+//
+// <Vm>.<Ts>[<index>],
+// { <Vt>.B, <Vt2>.B }[<index>].
type RegisterWithArrangementAndIndex struct {
r Reg
a Arrangement
// gnuArg formats arg (which is the argIndex's arg in inst) according to GNU rules.
// NOTE: because GNUSyntax is the only caller of this func, and it receives a copy
-// of inst, it's ok to modify inst.Args here.
+// of inst, it's ok to modify inst.Args here.
func gnuArg(inst *Inst, argIndex int, arg Arg, pc uint64) string {
// special cases for load/store instructions
if _, ok := arg.(Offset); ok {
)
// GNUSyntax returns the GNU assembler syntax for the instruction, as defined by GNU binutils.
-// This general form is often called ``AT&T syntax'' as a reference to AT&T System V Unix.
+// This general form is often called “AT&T syntax” as a reference to AT&T System V Unix.
func GNUSyntax(inst Inst, pc uint64, symname SymLookup) string {
// Rewrite instruction to mimic GNU peculiarities.
// Note that inst has been passed by value and contains
// the interface value instead of requiring an allocation.
// A Reg is a single register.
-// The zero Reg value has no name but indicates ``no register.''
+// The zero Reg value has no name but indicates “no register.”
type Reg uint8
const (
}
}
if !fixed {
- errorf("invalid go version '%s': must match format 1.23", args[0])
+ errorf("invalid go version '%s': must match format 1.23.0", args[0])
return
}
}
errorf("toolchain directive expects exactly one argument")
return
} else if strict && !ToolchainRE.MatchString(args[0]) {
- errorf("invalid toolchain version '%s': must match format go1.23 or local", args[0])
+ errorf("invalid toolchain version '%s': must match format go1.23.0 or local", args[0])
return
}
f.Toolchain = &Toolchain{Syntax: line}
// license that can be found in the LICENSE file.
//go:build go1.5
-// +build go1.5
package plan9
// license that can be found in the LICENSE file.
//go:build !go1.5
-// +build !go1.5
package plan9
// license that can be found in the LICENSE file.
//go:build plan9 && race
-// +build plan9,race
package plan9
// license that can be found in the LICENSE file.
//go:build plan9 && !race
-// +build plan9,!race
package plan9
// license that can be found in the LICENSE file.
//go:build plan9
-// +build plan9
package plan9
// license that can be found in the LICENSE file.
//go:build plan9
-// +build plan9
// Package plan9 contains an interface to the low-level operating system
// primitives. OS details vary depending on the underlying system, and
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build plan9 && 386
-// +build plan9,386
package plan9
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build plan9 && amd64
-// +build plan9,amd64
package plan9
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build plan9 && arm
-// +build plan9,arm
package plan9
// license that can be found in the LICENSE file.
//go:build (aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos) && go1.9
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
-// +build go1.9
package unix
// license that can be found in the LICENSE file.
//go:build gc
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build (freebsd || netbsd || openbsd) && gc
-// +build freebsd netbsd openbsd
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build (darwin || dragonfly || freebsd || netbsd || openbsd) && gc
-// +build darwin dragonfly freebsd netbsd openbsd
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build (freebsd || netbsd || openbsd) && gc
-// +build freebsd netbsd openbsd
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build (darwin || freebsd || netbsd || openbsd) && gc
-// +build darwin freebsd netbsd openbsd
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build (darwin || freebsd || netbsd || openbsd) && gc
-// +build darwin freebsd netbsd openbsd
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build (darwin || freebsd || netbsd || openbsd) && gc
-// +build darwin freebsd netbsd openbsd
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build gc
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build gc
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build gc
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build linux && arm64 && gc
-// +build linux
-// +build arm64
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build linux && loong64 && gc
-// +build linux
-// +build loong64
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build linux && (mips64 || mips64le) && gc
-// +build linux
-// +build mips64 mips64le
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build linux && (mips || mipsle) && gc
-// +build linux
-// +build mips mipsle
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build linux && (ppc64 || ppc64le) && gc
-// +build linux
-// +build ppc64 ppc64le
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build riscv64 && gc
-// +build riscv64
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build linux && s390x && gc
-// +build linux
-// +build s390x
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build gc
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build gc
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build zos && s390x && gc
-// +build zos
-// +build s390x
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build freebsd
-// +build freebsd
package unix
// license that can be found in the LICENSE file.
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
package unix
// license that can be found in the LICENSE file.
//go:build aix && ppc
-// +build aix,ppc
// Functions to access/create device major and minor numbers matching the
// encoding used by AIX.
// license that can be found in the LICENSE file.
//go:build aix && ppc64
-// +build aix,ppc64
// Functions to access/create device major and minor numbers matching the
// encoding used AIX.
// license that can be found in the LICENSE file.
//go:build zos && s390x
-// +build zos,s390x
// Functions to access/create device major and minor numbers matching the
// encoding used by z/OS.
// license that can be found in the LICENSE file.
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
package unix
// license that can be found in the LICENSE file.
//
//go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64
-// +build armbe arm64be m68k mips mips64 mips64p32 ppc ppc64 s390 s390x shbe sparc sparc64
package unix
// license that can be found in the LICENSE file.
//
//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh
-// +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh
package unix
// license that can be found in the LICENSE file.
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
// Unix environment variables.
// license that can be found in the LICENSE file.
//go:build zos && s390x
-// +build zos,s390x
package unix
// license that can be found in the LICENSE file.
//go:build dragonfly || freebsd || linux || netbsd || openbsd
-// +build dragonfly freebsd linux netbsd openbsd
package unix
// license that can be found in the LICENSE file.
//go:build (linux && 386) || (linux && arm) || (linux && mips) || (linux && mipsle) || (linux && ppc)
-// +build linux,386 linux,arm linux,mips linux,mipsle linux,ppc
package unix
// license that can be found in the LICENSE file.
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
package unix
// license that can be found in the LICENSE file.
//go:build zos && s390x
-// +build zos,s390x
package unix
// license that can be found in the LICENSE file.
//go:build gccgo && !aix && !hurd
-// +build gccgo,!aix,!hurd
package unix
// license that can be found in the LICENSE file.
//go:build gccgo && !aix && !hurd
-// +build gccgo,!aix,!hurd
#include <errno.h>
#include <stdint.h>
// license that can be found in the LICENSE file.
//go:build gccgo && linux && amd64
-// +build gccgo,linux,amd64
package unix
// license that can be found in the LICENSE file.
//go:build linux
-// +build linux
package unix
// license that can be found in the LICENSE file.
//go:build aix || solaris
-// +build aix solaris
package unix
// license that can be found in the LICENSE file.
//go:build darwin || dragonfly || freebsd || hurd || linux || netbsd || openbsd
-// +build darwin dragonfly freebsd hurd linux netbsd openbsd
package unix
// license that can be found in the LICENSE file.
//go:build zos && s390x
-// +build zos,s390x
package unix
echo '// Code generated by the command above; see README.md. DO NOT EDIT.'
echo
echo "//go:build ${GOARCH} && ${GOOS}"
-echo "// +build ${GOARCH},${GOOS}"
echo
go tool cgo -godefs -- "$@" _const.go >_error.out
cat _error.out | grep -vf _error.grep | grep -vf _signal.grep
// license that can be found in the LICENSE file.
//go:build aix || darwin || dragonfly || freebsd || openbsd || solaris
-// +build aix darwin dragonfly freebsd openbsd solaris
package unix
// license that can be found in the LICENSE file.
//go:build linux || netbsd
-// +build linux netbsd
package unix
// license that can be found in the LICENSE file.
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
// For Unix, get the pagesize from the runtime.
// license that can be found in the LICENSE file.
//go:build darwin && !ios
-// +build darwin,!ios
package unix
// license that can be found in the LICENSE file.
//go:build ios
-// +build ios
package unix
// license that can be found in the LICENSE file.
//go:build (darwin && race) || (linux && race) || (freebsd && race)
-// +build darwin,race linux,race freebsd,race
package unix
// license that can be found in the LICENSE file.
//go:build aix || (darwin && !race) || (linux && !race) || (freebsd && !race) || netbsd || openbsd || solaris || dragonfly || zos
-// +build aix darwin,!race linux,!race freebsd,!race netbsd openbsd solaris dragonfly zos
package unix
// license that can be found in the LICENSE file.
//go:build aix || dragonfly || freebsd || linux || netbsd || openbsd
-// +build aix dragonfly freebsd linux netbsd openbsd
package unix
// license that can be found in the LICENSE file.
//go:build darwin
-// +build darwin
package unix
// license that can be found in the LICENSE file.
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
// Socket control messages
// license that can be found in the LICENSE file.
//go:build aix || darwin || freebsd || linux || netbsd || openbsd || solaris || zos
-// +build aix darwin freebsd linux netbsd openbsd solaris zos
package unix
// license that can be found in the LICENSE file.
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
// Package unix contains an interface to the low-level operating system
// primitives. OS details vary depending on the underlying system, and
// license that can be found in the LICENSE file.
//go:build aix
-// +build aix
// Aix system calls.
// This file is compiled as ordinary Go code,
// license that can be found in the LICENSE file.
//go:build aix && ppc
-// +build aix,ppc
package unix
// license that can be found in the LICENSE file.
//go:build aix && ppc64
-// +build aix,ppc64
package unix
// license that can be found in the LICENSE file.
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
-// +build darwin dragonfly freebsd netbsd openbsd
// BSD system call wrappers shared by *BSD based systems
// including OS X (Darwin) and FreeBSD. Like the other
// license that can be found in the LICENSE file.
//go:build amd64 && darwin
-// +build amd64,darwin
package unix
// license that can be found in the LICENSE file.
//go:build arm64 && darwin
-// +build arm64,darwin
package unix
// license that can be found in the LICENSE file.
//go:build darwin && go1.12
-// +build darwin,go1.12
package unix
// license that can be found in the LICENSE file.
//go:build amd64 && dragonfly
-// +build amd64,dragonfly
package unix
// license that can be found in the LICENSE file.
//go:build 386 && freebsd
-// +build 386,freebsd
package unix
// license that can be found in the LICENSE file.
//go:build amd64 && freebsd
-// +build amd64,freebsd
package unix
// license that can be found in the LICENSE file.
//go:build arm && freebsd
-// +build arm,freebsd
package unix
// license that can be found in the LICENSE file.
//go:build arm64 && freebsd
-// +build arm64,freebsd
package unix
// license that can be found in the LICENSE file.
//go:build riscv64 && freebsd
-// +build riscv64,freebsd
package unix
// license that can be found in the LICENSE file.
//go:build hurd
-// +build hurd
package unix
// license that can be found in the LICENSE file.
//go:build 386 && hurd
-// +build 386,hurd
package unix
// illumos system calls not present on Solaris.
//go:build amd64 && illumos
-// +build amd64,illumos
package unix
}
return attr, nil
}
+
+//sys Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error)
// license that can be found in the LICENSE file.
//go:build 386 && linux
-// +build 386,linux
package unix
// license that can be found in the LICENSE file.
//go:build linux && (386 || amd64 || mips || mipsle || mips64 || mipsle || ppc64 || ppc64le || ppc || s390x || sparc64)
-// +build linux
-// +build 386 amd64 mips mipsle mips64 mipsle ppc64 ppc64le ppc s390x sparc64
package unix
// license that can be found in the LICENSE file.
//go:build amd64 && linux
-// +build amd64,linux
package unix
// license that can be found in the LICENSE file.
//go:build amd64 && linux && gc
-// +build amd64,linux,gc
package unix
// license that can be found in the LICENSE file.
//go:build arm && linux
-// +build arm,linux
package unix
// license that can be found in the LICENSE file.
//go:build arm64 && linux
-// +build arm64,linux
package unix
// license that can be found in the LICENSE file.
//go:build linux && gc
-// +build linux,gc
package unix
// license that can be found in the LICENSE file.
//go:build linux && gc && 386
-// +build linux,gc,386
package unix
// license that can be found in the LICENSE file.
//go:build arm && gc && linux
-// +build arm,gc,linux
package unix
// license that can be found in the LICENSE file.
//go:build linux && gccgo && 386
-// +build linux,gccgo,386
package unix
// license that can be found in the LICENSE file.
//go:build linux && gccgo && arm
-// +build linux,gccgo,arm
package unix
// license that can be found in the LICENSE file.
//go:build loong64 && linux
-// +build loong64,linux
package unix
// license that can be found in the LICENSE file.
//go:build linux && (mips64 || mips64le)
-// +build linux
-// +build mips64 mips64le
package unix
// license that can be found in the LICENSE file.
//go:build linux && (mips || mipsle)
-// +build linux
-// +build mips mipsle
package unix
// license that can be found in the LICENSE file.
//go:build linux && ppc
-// +build linux,ppc
package unix
// license that can be found in the LICENSE file.
//go:build linux && (ppc64 || ppc64le)
-// +build linux
-// +build ppc64 ppc64le
package unix
// license that can be found in the LICENSE file.
//go:build riscv64 && linux
-// +build riscv64,linux
package unix
// license that can be found in the LICENSE file.
//go:build s390x && linux
-// +build s390x,linux
package unix
// license that can be found in the LICENSE file.
//go:build sparc64 && linux
-// +build sparc64,linux
package unix
// license that can be found in the LICENSE file.
//go:build 386 && netbsd
-// +build 386,netbsd
package unix
// license that can be found in the LICENSE file.
//go:build amd64 && netbsd
-// +build amd64,netbsd
package unix
// license that can be found in the LICENSE file.
//go:build arm && netbsd
-// +build arm,netbsd
package unix
// license that can be found in the LICENSE file.
//go:build arm64 && netbsd
-// +build arm64,netbsd
package unix
// license that can be found in the LICENSE file.
//go:build 386 && openbsd
-// +build 386,openbsd
package unix
// license that can be found in the LICENSE file.
//go:build amd64 && openbsd
-// +build amd64,openbsd
package unix
// license that can be found in the LICENSE file.
//go:build arm && openbsd
-// +build arm,openbsd
package unix
// license that can be found in the LICENSE file.
//go:build arm64 && openbsd
-// +build arm64,openbsd
package unix
// license that can be found in the LICENSE file.
//go:build openbsd
-// +build openbsd
package unix
// license that can be found in the LICENSE file.
//go:build ppc64 && openbsd
-// +build ppc64,openbsd
package unix
// license that can be found in the LICENSE file.
//go:build riscv64 && openbsd
-// +build riscv64,openbsd
package unix
// license that can be found in the LICENSE file.
//go:build amd64 && solaris
-// +build amd64,solaris
package unix
// license that can be found in the LICENSE file.
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris
package unix
// license that can be found in the LICENSE file.
//go:build (darwin || dragonfly || freebsd || (linux && !ppc64 && !ppc64le) || netbsd || openbsd || solaris) && gc
-// +build darwin dragonfly freebsd linux,!ppc64,!ppc64le netbsd openbsd solaris
-// +build gc
package unix
// license that can be found in the LICENSE file.
//go:build linux && (ppc64le || ppc64) && gc
-// +build linux
-// +build ppc64le ppc64
-// +build gc
package unix
// license that can be found in the LICENSE file.
//go:build zos && s390x
-// +build zos,s390x
package unix
// license that can be found in the LICENSE file.
//go:build linux
-// +build linux
package unix
// license that can be found in the LICENSE file.
//go:build (darwin && !ios) || linux
-// +build darwin,!ios linux
package unix
// license that can be found in the LICENSE file.
//go:build darwin && !ios
-// +build darwin,!ios
package unix
// license that can be found in the LICENSE file.
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
package unix
// license that can be found in the LICENSE file.
//go:build freebsd || netbsd
-// +build freebsd netbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc && aix
-// +build ppc,aix
// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs -- -maix32 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc64 && aix
-// +build ppc64,aix
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -maix64 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && darwin
-// +build amd64,darwin
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m64 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm64 && darwin
-// +build arm64,darwin
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m64 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && dragonfly
-// +build amd64,dragonfly
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m64 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build 386 && freebsd
-// +build 386,freebsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m32 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && freebsd
-// +build amd64,freebsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m64 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm && freebsd
-// +build arm,freebsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm64 && freebsd
-// +build arm64,freebsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m64 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build riscv64 && freebsd
-// +build riscv64,freebsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m64 _const.go
// Code generated by mkmerge; DO NOT EDIT.
//go:build linux
-// +build linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build 386 && linux
-// +build 386,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/386/include -m32 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && linux
-// +build amd64,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/amd64/include -m64 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm && linux
-// +build arm,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/arm/include _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm64 && linux
-// +build arm64,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/arm64/include -fsigned-char _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build loong64 && linux
-// +build loong64,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/loong64/include _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips && linux
-// +build mips,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/mips/include _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips64 && linux
-// +build mips64,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/mips64/include _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips64le && linux
-// +build mips64le,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/mips64le/include _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mipsle && linux
-// +build mipsle,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/mipsle/include _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc && linux
-// +build ppc,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/ppc/include _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc64 && linux
-// +build ppc64,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/ppc64/include _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc64le && linux
-// +build ppc64le,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/ppc64le/include _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build riscv64 && linux
-// +build riscv64,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/riscv64/include _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build s390x && linux
-// +build s390x,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/s390x/include -fsigned-char _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build sparc64 && linux
-// +build sparc64,linux
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -Wall -Werror -static -I/tmp/sparc64/include _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build 386 && netbsd
-// +build 386,netbsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m32 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && netbsd
-// +build amd64,netbsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m64 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm && netbsd
-// +build arm,netbsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -marm _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm64 && netbsd
-// +build arm64,netbsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m64 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build 386 && openbsd
-// +build 386,openbsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m32 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && openbsd
-// +build amd64,openbsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m64 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm && openbsd
-// +build arm,openbsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm64 && openbsd
-// +build arm64,openbsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m64 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips64 && openbsd
-// +build mips64,openbsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m64 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc64 && openbsd
-// +build ppc64,openbsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m64 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build riscv64 && openbsd
-// +build riscv64,openbsd
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m64 _const.go
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && solaris
-// +build amd64,solaris
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m64 _const.go
// license that can be found in the LICENSE file.
//go:build zos && s390x
-// +build zos,s390x
// Hand edited based on zerrors_linux_s390x.go
// TODO: auto-generate.
// Code generated by linux/mkall.go generatePtracePair("arm", "arm64"). DO NOT EDIT.
//go:build linux && (arm || arm64)
-// +build linux
-// +build arm arm64
package unix
// Code generated by linux/mkall.go generatePtracePair("mips", "mips64"). DO NOT EDIT.
//go:build linux && (mips || mips64)
-// +build linux
-// +build mips mips64
package unix
// Code generated by linux/mkall.go generatePtracePair("mipsle", "mips64le"). DO NOT EDIT.
//go:build linux && (mipsle || mips64le)
-// +build linux
-// +build mipsle mips64le
package unix
// Code generated by linux/mkall.go generatePtracePair("386", "amd64"). DO NOT EDIT.
//go:build linux && (386 || amd64)
-// +build linux
-// +build 386 amd64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build aix && ppc
-// +build aix,ppc
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build aix && ppc64
-// +build aix,ppc64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build aix && ppc64 && gc
-// +build aix,ppc64,gc
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build aix && ppc64 && gccgo
-// +build aix,ppc64,gccgo
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build darwin && amd64
-// +build darwin,amd64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build darwin && arm64
-// +build darwin,arm64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build dragonfly && amd64
-// +build dragonfly,amd64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build freebsd && 386
-// +build freebsd,386
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build freebsd && amd64
-// +build freebsd,amd64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build freebsd && arm
-// +build freebsd,arm
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build freebsd && arm64
-// +build freebsd,arm64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build freebsd && riscv64
-// +build freebsd,riscv64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build illumos && amd64
-// +build illumos,amd64
package unix
// Code generated by mkmerge; DO NOT EDIT.
//go:build linux
-// +build linux
package unix
}
return
}
+
+// THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
+
+func Cachestat(fd uint, crange *CachestatRange, cstat *Cachestat_t, flags uint) (err error) {
+ _, _, e1 := Syscall6(SYS_CACHESTAT, uintptr(fd), uintptr(unsafe.Pointer(crange)), uintptr(unsafe.Pointer(cstat)), uintptr(flags), 0, 0)
+ if e1 != 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build linux && 386
-// +build linux,386
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build linux && amd64
-// +build linux,amd64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build linux && arm
-// +build linux,arm
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build linux && arm64
-// +build linux,arm64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build linux && loong64
-// +build linux,loong64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build linux && mips
-// +build linux,mips
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build linux && mips64
-// +build linux,mips64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build linux && mips64le
-// +build linux,mips64le
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build linux && mipsle
-// +build linux,mipsle
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build linux && ppc
-// +build linux,ppc
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build linux && ppc64
-// +build linux,ppc64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build linux && ppc64le
-// +build linux,ppc64le
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build linux && riscv64
-// +build linux,riscv64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build linux && s390x
-// +build linux,s390x
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build linux && sparc64
-// +build linux,sparc64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build netbsd && 386
-// +build netbsd,386
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build netbsd && amd64
-// +build netbsd,amd64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build netbsd && arm
-// +build netbsd,arm
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build netbsd && arm64
-// +build netbsd,arm64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build openbsd && 386
-// +build openbsd,386
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build openbsd && amd64
-// +build openbsd,amd64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build openbsd && arm
-// +build openbsd,arm
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build openbsd && arm64
-// +build openbsd,arm64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build openbsd && mips64
-// +build openbsd,mips64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build openbsd && ppc64
-// +build openbsd,ppc64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build openbsd && riscv64
-// +build openbsd,riscv64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build solaris && amd64
-// +build solaris,amd64
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build zos && s390x
-// +build zos,s390x
package unix
// Code generated by the command above; DO NOT EDIT.
//go:build 386 && openbsd
-// +build 386,openbsd
package unix
// Code generated by the command above; DO NOT EDIT.
//go:build amd64 && openbsd
-// +build amd64,openbsd
package unix
// Code generated by the command above; DO NOT EDIT.
//go:build arm && openbsd
-// +build arm,openbsd
package unix
// Code generated by the command above; DO NOT EDIT.
//go:build arm64 && openbsd
-// +build arm64,openbsd
package unix
// Code generated by the command above; DO NOT EDIT.
//go:build mips64 && openbsd
-// +build mips64,openbsd
package unix
// Code generated by the command above; DO NOT EDIT.
//go:build ppc64 && openbsd
-// +build ppc64,openbsd
package unix
// Code generated by the command above; DO NOT EDIT.
//go:build riscv64 && openbsd
-// +build riscv64,openbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && darwin
-// +build amd64,darwin
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm64 && darwin
-// +build arm64,darwin
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && dragonfly
-// +build amd64,dragonfly
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build 386 && freebsd
-// +build 386,freebsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && freebsd
-// +build amd64,freebsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm && freebsd
-// +build arm,freebsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm64 && freebsd
-// +build arm64,freebsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build riscv64 && freebsd
-// +build riscv64,freebsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build 386 && linux
-// +build 386,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && linux
-// +build amd64,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm && linux
-// +build arm,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm64 && linux
-// +build arm64,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build loong64 && linux
-// +build loong64,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips && linux
-// +build mips,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips64 && linux
-// +build mips64,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips64le && linux
-// +build mips64le,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mipsle && linux
-// +build mipsle,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc && linux
-// +build ppc,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc64 && linux
-// +build ppc64,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc64le && linux
-// +build ppc64le,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build riscv64 && linux
-// +build riscv64,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build s390x && linux
-// +build s390x,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build sparc64 && linux
-// +build sparc64,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build 386 && netbsd
-// +build 386,netbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && netbsd
-// +build amd64,netbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm && netbsd
-// +build arm,netbsd
package unix
// Code generated by the command above; DO NOT EDIT.
//go:build arm64 && netbsd
-// +build arm64,netbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build 386 && openbsd
-// +build 386,openbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && openbsd
-// +build amd64,openbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm && openbsd
-// +build arm,openbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm64 && openbsd
-// +build arm64,openbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips64 && openbsd
-// +build mips64,openbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc64 && openbsd
-// +build ppc64,openbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build riscv64 && openbsd
-// +build riscv64,openbsd
package unix
// license that can be found in the LICENSE file.
//go:build zos && s390x
-// +build zos,s390x
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc && aix
-// +build ppc,aix
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc64 && aix
-// +build ppc64,aix
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && darwin
-// +build amd64,darwin
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm64 && darwin
-// +build arm64,darwin
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && dragonfly
-// +build amd64,dragonfly
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build 386 && freebsd
-// +build 386,freebsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && freebsd
-// +build amd64,freebsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm && freebsd
-// +build arm,freebsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm64 && freebsd
-// +build arm64,freebsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build riscv64 && freebsd
-// +build riscv64,freebsd
package unix
// Code generated by mkmerge; DO NOT EDIT.
//go:build linux
-// +build linux
package unix
}
const SizeofSchedAttr = 0x38
+
+type Cachestat_t struct {
+ Cache uint64
+ Dirty uint64
+ Writeback uint64
+ Evicted uint64
+ Recently_evicted uint64
+}
+type CachestatRange struct {
+ Off uint64
+ Len uint64
+}
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build 386 && linux
-// +build 386,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && linux
-// +build amd64,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm && linux
-// +build arm,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm64 && linux
-// +build arm64,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build loong64 && linux
-// +build loong64,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips && linux
-// +build mips,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips64 && linux
-// +build mips64,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips64le && linux
-// +build mips64le,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mipsle && linux
-// +build mipsle,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc && linux
-// +build ppc,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc64 && linux
-// +build ppc64,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc64le && linux
-// +build ppc64le,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build riscv64 && linux
-// +build riscv64,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build s390x && linux
-// +build s390x,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build sparc64 && linux
-// +build sparc64,linux
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build 386 && netbsd
-// +build 386,netbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && netbsd
-// +build amd64,netbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm && netbsd
-// +build arm,netbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm64 && netbsd
-// +build arm64,netbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build 386 && openbsd
-// +build 386,openbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && openbsd
-// +build amd64,openbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm && openbsd
-// +build arm,openbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build arm64 && openbsd
-// +build arm64,openbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build mips64 && openbsd
-// +build mips64,openbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build ppc64 && openbsd
-// +build ppc64,openbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build riscv64 && openbsd
-// +build riscv64,openbsd
package unix
// Code generated by the command above; see README.md. DO NOT EDIT.
//go:build amd64 && solaris
-// +build amd64,solaris
package unix
// license that can be found in the LICENSE file.
//go:build zos && s390x
-// +build zos,s390x
// Hand edited based on ztypes_linux_s390x.go
// TODO: auto-generate.
// license that can be found in the LICENSE file.
//go:build windows && go1.9
-// +build windows,go1.9
package windows
// license that can be found in the LICENSE file.
//go:build !go1.12
-// +build !go1.12
// This file is here to allow bodyless functions with go:linkname for Go 1.11
// and earlier (see https://golang.org/issue/23311).
// license that can be found in the LICENSE file.
//go:build windows
-// +build windows
package windows
// license that can be found in the LICENSE file.
//go:build generate
-// +build generate
package windows
// license that can be found in the LICENSE file.
//go:build windows && race
-// +build windows,race
package windows
// license that can be found in the LICENSE file.
//go:build windows && !race
-// +build windows,!race
package windows
// license that can be found in the LICENSE file.
//go:build windows
-// +build windows
package windows
// license that can be found in the LICENSE file.
//go:build windows
-// +build windows
package windows
// license that can be found in the LICENSE file.
//go:build windows
-// +build windows
// Package windows contains an interface to the low-level operating system
// primitives. OS details vary depending on the underlying system, and
//sys CreateEnvironmentBlock(block **uint16, token Token, inheritExisting bool) (err error) = userenv.CreateEnvironmentBlock
//sys DestroyEnvironmentBlock(block *uint16) (err error) = userenv.DestroyEnvironmentBlock
//sys getTickCount64() (ms uint64) = kernel32.GetTickCount64
+//sys GetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error)
//sys SetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error)
//sys GetFileAttributes(name *uint16) (attrs uint32, err error) [failretval==INVALID_FILE_ATTRIBUTES] = kernel32.GetFileAttributesW
//sys SetFileAttributes(name *uint16, attrs uint32) (err error) = kernel32.SetFileAttributesW
SOMAXCONN = 0x7fffffff
- TCP_NODELAY = 1
+ TCP_NODELAY = 1
+ TCP_EXPEDITED_1122 = 2
+ TCP_KEEPALIVE = 3
+ TCP_MAXSEG = 4
+ TCP_MAXRT = 5
+ TCP_STDURG = 6
+ TCP_NOURG = 7
+ TCP_ATMARK = 8
+ TCP_NOSYNRETRIES = 9
+ TCP_TIMESTAMPS = 10
+ TCP_OFFLOAD_PREFERENCE = 11
+ TCP_CONGESTION_ALGORITHM = 12
+ TCP_DELAY_FIN_ACK = 13
+ TCP_MAXRTMS = 14
+ TCP_FASTOPEN = 15
+ TCP_KEEPCNT = 16
+ TCP_KEEPIDLE = TCP_KEEPALIVE
+ TCP_KEEPINTVL = 17
+ TCP_FAIL_CONNECT_ON_ICMP_ERROR = 18
+ TCP_ICMP_ERROR_INFO = 19
+
+ UDP_NOCHECKSUM = 1
+ UDP_SEND_MSG_SIZE = 2
+ UDP_RECV_MAX_COALESCED_SIZE = 3
+ UDP_CHECKSUM_COVERAGE = 20
+
+ UDP_COALESCED_INFO = 3
SHUT_RD = 0
SHUT_WR = 1
procGetFileAttributesW = modkernel32.NewProc("GetFileAttributesW")
procGetFileInformationByHandle = modkernel32.NewProc("GetFileInformationByHandle")
procGetFileInformationByHandleEx = modkernel32.NewProc("GetFileInformationByHandleEx")
+ procGetFileTime = modkernel32.NewProc("GetFileTime")
procGetFileType = modkernel32.NewProc("GetFileType")
procGetFinalPathNameByHandleW = modkernel32.NewProc("GetFinalPathNameByHandleW")
procGetFullPathNameW = modkernel32.NewProc("GetFullPathNameW")
return
}
+func GetFileTime(handle Handle, ctime *Filetime, atime *Filetime, wtime *Filetime) (err error) {
+ r1, _, e1 := syscall.Syscall6(procGetFileTime.Addr(), 4, uintptr(handle), uintptr(unsafe.Pointer(ctime)), uintptr(unsafe.Pointer(atime)), uintptr(unsafe.Pointer(wtime)), 0, 0)
+ if r1 == 0 {
+ err = errnoErr(e1)
+ }
+ return
+}
+
func GetFileType(filehandle Handle) (n uint32, err error) {
r0, _, e1 := syscall.Syscall(procGetFileType.Addr(), 1, uintptr(filehandle), 0, 0)
n = uint32(r0)
// license that can be found in the LICENSE file.
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
package term
// license that can be found in the LICENSE file.
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
-// +build darwin dragonfly freebsd netbsd openbsd
package term
// license that can be found in the LICENSE file.
//go:build aix || linux || solaris || zos
-// +build aix linux solaris zos
package term
// license that can be found in the LICENSE file.
//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !zos && !windows && !solaris && !plan9
-// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!zos,!windows,!solaris,!plan9
package term
"golang.org/x/tools/go/analysis/passes/inspect"
"golang.org/x/tools/go/analysis/passes/internal/analysisutil"
"golang.org/x/tools/go/ast/inspector"
+ "golang.org/x/tools/go/types/typeutil"
)
//go:embed doc.go
}
inspect.Preorder(nodeFilter, func(n ast.Node) {
call := n.(*ast.CallExpr)
- if ident, ok := call.Fun.(*ast.Ident); ok && ident.Name == "append" {
- if _, ok := pass.TypesInfo.Uses[ident].(*types.Builtin); ok {
- if len(call.Args) == 1 {
- pass.ReportRangef(call, "append with no values")
- }
- }
+ b, ok := typeutil.Callee(pass.TypesInfo, call).(*types.Builtin)
+ if ok && b.Name() == "append" && len(call.Args) == 1 {
+ pass.ReportRangef(call, "append with no values")
}
})
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/inspect"
"golang.org/x/tools/go/analysis/passes/internal/analysisutil"
+ "golang.org/x/tools/go/ast/astutil"
"golang.org/x/tools/go/ast/inspector"
)
// isMapIndex returns true if e is a map index expression.
func isMapIndex(info *types.Info, e ast.Expr) bool {
- if idx, ok := analysisutil.Unparen(e).(*ast.IndexExpr); ok {
+ if idx, ok := astutil.Unparen(e).(*ast.IndexExpr); ok {
if typ := info.Types[idx.X].Type; typ != nil {
_, ok := typ.Underlying().(*types.Map)
return ok
_ "embed"
"go/ast"
"go/token"
- "go/types"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/inspect"
"golang.org/x/tools/go/analysis/passes/internal/analysisutil"
"golang.org/x/tools/go/ast/inspector"
+ "golang.org/x/tools/go/types/typeutil"
)
//go:embed doc.go
if !ok {
continue
}
- sel, ok := call.Fun.(*ast.SelectorExpr)
- if !ok {
- continue
- }
- pkgIdent, _ := sel.X.(*ast.Ident)
- pkgName, ok := pass.TypesInfo.Uses[pkgIdent].(*types.PkgName)
- if !ok || pkgName.Imported().Path() != "sync/atomic" {
- continue
- }
-
- switch sel.Sel.Name {
- case "AddInt32", "AddInt64", "AddUint32", "AddUint64", "AddUintptr":
+ fn := typeutil.StaticCallee(pass.TypesInfo, call)
+ if analysisutil.IsFunctionNamed(fn, "sync/atomic", "AddInt32", "AddInt64", "AddUint32", "AddUint64", "AddUintptr") {
checkAtomicAddAssignment(pass, n.Lhs[i], call)
}
}
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/inspect"
"golang.org/x/tools/go/analysis/passes/internal/analysisutil"
+ "golang.org/x/tools/go/ast/astutil"
"golang.org/x/tools/go/ast/inspector"
)
i := 0
var sets [][]ast.Expr
for j := 0; j <= len(exprs); j++ {
- if j == len(exprs) || hasSideEffects(info, exprs[j]) {
+ if j == len(exprs) || analysisutil.HasSideEffects(info, exprs[j]) {
if i < j {
sets = append(sets, exprs[i:j])
}
}
}
-// hasSideEffects reports whether evaluation of e has side effects.
-func hasSideEffects(info *types.Info, e ast.Expr) bool {
- safe := true
- ast.Inspect(e, func(node ast.Node) bool {
- switch n := node.(type) {
- case *ast.CallExpr:
- typVal := info.Types[n.Fun]
- switch {
- case typVal.IsType():
- // Type conversion, which is safe.
- case typVal.IsBuiltin():
- // Builtin func, conservatively assumed to not
- // be safe for now.
- safe = false
- return false
- default:
- // A non-builtin func or method call.
- // Conservatively assume that all of them have
- // side effects for now.
- safe = false
- return false
- }
- case *ast.UnaryExpr:
- if n.Op == token.ARROW {
- safe = false
- return false
- }
- }
- return true
- })
- return !safe
-}
-
// split returns a slice of all subexpressions in e that are connected by op.
// For example, given 'a || (b || c) || d' with the or op,
// split returns []{d, c, b, a}.
// seen[e] is already true; any newly processed exprs are added to seen.
func (op boolOp) split(e ast.Expr, seen map[*ast.BinaryExpr]bool) (exprs []ast.Expr) {
for {
- e = unparen(e)
+ e = astutil.Unparen(e)
if b, ok := e.(*ast.BinaryExpr); ok && b.Op == op.tok {
seen[b] = true
exprs = append(exprs, op.split(b.Y, seen)...)
}
return
}
-
-// unparen returns e with any enclosing parentheses stripped.
-func unparen(e ast.Expr) ast.Expr {
- for {
- p, ok := e.(*ast.ParenExpr)
- if !ok {
- return e
- }
- e = p.X
- }
-}
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/internal/analysisutil"
+ "golang.org/x/tools/go/ast/astutil"
)
const debug = false
// Is this a C.f() call?
var name string
- if sel, ok := analysisutil.Unparen(call.Fun).(*ast.SelectorExpr); ok {
+ if sel, ok := astutil.Unparen(call.Fun).(*ast.SelectorExpr); ok {
if id, ok := sel.X.(*ast.Ident); ok && id.Name == "C" {
name = sel.Sel.Name
}
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/inspect"
"golang.org/x/tools/go/analysis/passes/internal/analysisutil"
+ "golang.org/x/tools/go/ast/astutil"
"golang.org/x/tools/go/ast/inspector"
"golang.org/x/tools/internal/typeparams"
)
}
func lockPathRhs(pass *analysis.Pass, x ast.Expr) typePath {
- x = analysisutil.Unparen(x) // ignore parens on rhs
+ x = astutil.Unparen(x) // ignore parens on rhs
if _, ok := x.(*ast.CompositeLit); ok {
return nil
return nil
}
if star, ok := x.(*ast.StarExpr); ok {
- if _, ok := analysisutil.Unparen(star.X).(*ast.CallExpr); ok {
+ if _, ok := astutil.Unparen(star.X).(*ast.CallExpr); ok {
// A call may return a pointer to a zero value.
return nil
}
// In go1.10, sync.noCopy did not implement Locker.
// (The Unlock method was added only in CL 121876.)
// TODO(adonovan): remove workaround when we drop go1.10.
- if named, ok := typ.(*types.Named); ok &&
- named.Obj().Name() == "noCopy" &&
- named.Obj().Pkg().Path() == "sync" {
+ if analysisutil.IsNamedType(typ, "sync", "noCopy") {
return []string{typ.String()}
}
import (
_ "embed"
"go/ast"
- "go/types"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/inspect"
checkDeferCall := func(node ast.Node) bool {
switch v := node.(type) {
case *ast.CallExpr:
- fn, ok := typeutil.Callee(pass.TypesInfo, v).(*types.Func)
- if ok && fn.Name() == "Since" && fn.Pkg().Path() == "time" {
+ if analysisutil.IsFunctionNamed(typeutil.StaticCallee(pass.TypesInfo, v), "time", "Since") {
pass.Reportf(v.Pos(), "call to time.Since is not deferred")
}
case *ast.FuncLit:
for text != "" {
offset := len(fullText) - len(text)
var line string
- line, text, _ = stringsCut(text, "\n")
+ line, text, _ = strings.Cut(text, "\n")
if !inStar && strings.HasPrefix(line, "//") {
check.comment(pos+token.Pos(offset), line)
line = strings.TrimSpace(line)
if inStar {
var ok bool
- _, line, ok = stringsCut(line, "*/")
+ _, line, ok = strings.Cut(line, "*/")
if !ok {
break
}
}
}
-// Go 1.18 strings.Cut.
-func stringsCut(s, sep string) (before, after string, found bool) {
- if i := strings.Index(s, sep); i >= 0 {
- return s[:i], s[i+len(sep):], true
- }
- return s, "", false
-}
-
// Go 1.20 strings.CutPrefix.
func stringsCutPrefix(s, prefix string) (after string, found bool) {
if !strings.HasPrefix(s, prefix) {
inspect.Preorder(nodeFilter, func(n ast.Node) {
call := n.(*ast.CallExpr)
fn := typeutil.StaticCallee(pass.TypesInfo, call)
- if fn == nil {
- return // not a static call
+ if !analysisutil.IsFunctionNamed(fn, "errors", "As") {
+ return
}
if len(call.Args) < 2 {
return // not enough arguments, e.g. called with return values of another function
}
- if fn.FullName() != "errors.As" {
- return
- }
if err := checkAsTarget(pass, call.Args[1]); err != nil {
pass.ReportRangef(call, "%v", err)
}
if res.Len() != 2 {
return false // the function called does not return two values.
}
- if ptr, ok := res.At(0).Type().(*types.Pointer); !ok || !isNamedType(ptr.Elem(), "net/http", "Response") {
+ if ptr, ok := res.At(0).Type().(*types.Pointer); !ok || !analysisutil.IsNamedType(ptr.Elem(), "net/http", "Response") {
return false // the first return type is not *http.Response.
}
return ok && id.Name == "http" // function in net/http package.
}
- if isNamedType(typ, "net/http", "Client") {
+ if analysisutil.IsNamedType(typ, "net/http", "Client") {
return true // method on http.Client.
}
ptr, ok := typ.(*types.Pointer)
- return ok && isNamedType(ptr.Elem(), "net/http", "Client") // method on *http.Client.
+ return ok && analysisutil.IsNamedType(ptr.Elem(), "net/http", "Client") // method on *http.Client.
}
// restOfBlock, given a traversal stack, finds the innermost containing
return nil
}
}
-
-// isNamedType reports whether t is the named type path.name.
-func isNamedType(t types.Type, path, name string) bool {
- n, ok := t.(*types.Named)
- if !ok {
- return false
- }
- obj := n.Obj()
- return obj.Name() == name && obj.Pkg() != nil && obj.Pkg().Path() == path
-}
return !safe
}
-// Unparen returns e with any enclosing parentheses stripped.
-func Unparen(e ast.Expr) ast.Expr {
- for {
- p, ok := e.(*ast.ParenExpr)
- if !ok {
- return e
- }
- e = p.X
- }
-}
-
// ReadFile reads a file and adds it to the FileSet
// so that we can report errors against it using lineStart.
func ReadFile(fset *token.FileSet, filename string) ([]byte, *token.File, error) {
}
return false
}
+
+// IsNamedType reports whether t is the named type with the given package path
+// and one of the given names.
+// This function avoids allocating the concatenation of "pkg.Name",
+// which is important for the performance of syntax matching.
+func IsNamedType(t types.Type, pkgPath string, names ...string) bool {
+ n, ok := t.(*types.Named)
+ if !ok {
+ return false
+ }
+ obj := n.Obj()
+ if obj == nil || obj.Pkg() == nil || obj.Pkg().Path() != pkgPath {
+ return false
+ }
+ name := obj.Name()
+ for _, n := range names {
+ if name == n {
+ return true
+ }
+ }
+ return false
+}
+
+// IsFunctionNamed reports whether f is a top-level function defined in the
+// given package and has one of the given names.
+// It returns false if f is nil or a method.
+func IsFunctionNamed(f *types.Func, pkgPath string, names ...string) bool {
+ if f == nil {
+ return false
+ }
+ if f.Pkg() == nil || f.Pkg().Path() != pkgPath {
+ return false
+ }
+ if f.Type().(*types.Signature).Recv() != nil {
+ return false
+ }
+ for _, n := range names {
+ if f.Name() == n {
+ return true
+ }
+ }
+ return false
+}
if ptr, ok := recv.Type().(*types.Pointer); ok {
rtype = ptr.Elem()
}
- named, ok := rtype.(*types.Named)
- if !ok {
- return false
- }
- if named.Obj().Name() != typeName {
- return false
- }
- pkg := f.Pkg()
- if pkg == nil {
- return false
- }
- if pkg.Path() != pkgPath {
- return false
- }
-
- return true
+ return analysisutil.IsNamedType(rtype, pkgPath, typeName)
}
sig := fn.Type().(*types.Signature)
return sig.Params().Len() == 2 &&
sig.Results().Len() == 0 &&
- isNamed(sig.Params().At(0).Type(), "fmt", "State") &&
+ analysisutil.IsNamedType(sig.Params().At(0).Type(), "fmt", "State") &&
types.Identical(sig.Params().At(1).Type(), types.Typ[types.Rune])
}
-func isNamed(T types.Type, pkgpath, name string) bool {
- named, ok := T.(*types.Named)
- return ok && named.Obj().Pkg().Path() == pkgpath && named.Obj().Name() == name
-}
-
// formatState holds the parsed representation of a printf directive such as "%3.*[4]d".
// It is constructed by parsePrintfVerb.
type formatState struct {
}
func isAttr(t types.Type) bool {
- return isNamed(t, "log/slog", "Attr")
+ return analysisutil.IsNamedType(t, "log/slog", "Attr")
}
// shortName returns a name for the function that is shorter than FullName.
sel := info.Selections[s]
return sel != nil && sel.Kind() == types.MethodExpr
}
-
-// isNamed reports whether t is exactly a named type in a package with a given path.
-func isNamed(t types.Type, path, name string) bool {
- if n, ok := t.(*types.Named); ok {
- obj := n.Obj()
- return obj.Pkg() != nil && obj.Pkg().Path() == path && obj.Name() == name
- }
- return false
-}
if !ok {
return false
}
- named, ok := ptr.Elem().(*types.Named)
- if !ok {
- return false
- }
- obj := named.Obj()
- // obj.Pkg is nil for the error type.
- return obj != nil && obj.Pkg() != nil && obj.Pkg().Path() == "testing" && obj.Name() == testingType
+ return analysisutil.IsNamedType(ptr.Elem(), "testing", testingType)
}
// Validate that fuzz target function's arguments are of accepted types.
}
func isTimeDotFormat(f *types.Func) bool {
- if f.Name() != "Format" || f.Pkg().Path() != "time" {
- return false
- }
- sig, ok := f.Type().(*types.Signature)
- if !ok {
+ if f.Name() != "Format" || f.Pkg() == nil || f.Pkg().Path() != "time" {
return false
}
// Verify that the receiver is time.Time.
- recv := sig.Recv()
- if recv == nil {
- return false
- }
- named, ok := recv.Type().(*types.Named)
- return ok && named.Obj().Name() == "Time"
+ recv := f.Type().(*types.Signature).Recv()
+ return recv != nil && analysisutil.IsNamedType(recv.Type(), "time", "Time")
}
func isTimeDotParse(f *types.Func) bool {
- if f.Name() != "Parse" || f.Pkg().Path() != "time" {
- return false
- }
- // Verify that there is no receiver.
- sig, ok := f.Type().(*types.Signature)
- return ok && sig.Recv() == nil
+ return analysisutil.IsFunctionNamed(f, "time", "Parse")
}
// badFormatAt return the start of a bad format in e or -1 if no bad format is found.
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/inspect"
"golang.org/x/tools/go/analysis/passes/internal/analysisutil"
+ "golang.org/x/tools/go/ast/astutil"
"golang.org/x/tools/go/ast/inspector"
)
// Check unsafe.Pointer safety rules according to
// https://golang.org/pkg/unsafe/#Pointer.
- switch x := analysisutil.Unparen(x).(type) {
+ switch x := astutil.Unparen(x).(type) {
case *ast.SelectorExpr:
// "(6) Conversion of a reflect.SliceHeader or
// reflect.StringHeader Data field to or from Pointer."
}
switch sel.Sel.Name {
case "Pointer", "UnsafeAddr":
- t, ok := info.Types[sel.X].Type.(*types.Named)
- if ok && t.Obj().Pkg().Path() == "reflect" && t.Obj().Name() == "Value" {
+ if analysisutil.IsNamedType(info.Types[sel.X].Type, "reflect", "Value") {
return true
}
}
// isSafeArith reports whether x is a pointer arithmetic expression that is safe
// to convert to unsafe.Pointer.
func isSafeArith(info *types.Info, x ast.Expr) bool {
- switch x := analysisutil.Unparen(x).(type) {
+ switch x := astutil.Unparen(x).(type) {
case *ast.CallExpr:
// Base case: initial conversion from unsafe.Pointer to uintptr.
return len(x.Args) == 1 &&
// isReflectHeader reports whether t is reflect.SliceHeader or reflect.StringHeader.
func isReflectHeader(t types.Type) bool {
- if named, ok := t.(*types.Named); ok {
- if obj := named.Obj(); obj.Pkg() != nil && obj.Pkg().Path() == "reflect" {
- switch obj.Name() {
- case "SliceHeader", "StringHeader":
- return true
- }
- }
- }
- return false
+ return analysisutil.IsNamedType(t, "reflect", "SliceHeader", "StringHeader")
}
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/inspect"
"golang.org/x/tools/go/analysis/passes/internal/analysisutil"
+ "golang.org/x/tools/go/ast/astutil"
"golang.org/x/tools/go/ast/inspector"
"golang.org/x/tools/go/types/typeutil"
)
(*ast.ExprStmt)(nil),
}
inspect.Preorder(nodeFilter, func(n ast.Node) {
- call, ok := analysisutil.Unparen(n.(*ast.ExprStmt).X).(*ast.CallExpr)
+ call, ok := astutil.Unparen(n.(*ast.ExprStmt).X).(*ast.CallExpr)
if !ok {
return // not a call statement
}
if !ok {
return // e.g. var or builtin
}
-
if sig := fn.Type().(*types.Signature); sig.Recv() != nil {
// method (e.g. foo.String())
if types.Identical(sig, sigNoArgsStringResult) {
analyzers = filtered
// Read facts from imported packages.
- facts, err := facts.NewDecoder(pkg).Decode(false, makeFactImporter(cfg))
+ facts, err := facts.NewDecoder(pkg).Decode(makeFactImporter(cfg))
if err != nil {
return nil, err
}
results[i].diagnostics = act.diagnostics
}
- data := facts.Encode(false)
+ data := facts.Encode()
if err := exportFacts(cfg, data); err != nil {
return nil, fmt.Errorf("failed to export analysis facts: %v", err)
}
import (
"fmt"
"go/types"
- "sort"
"strconv"
"strings"
- _ "unsafe"
"golang.org/x/tools/internal/typeparams"
- "golang.org/x/tools/internal/typesinternal"
)
// A Path is an opaque name that identifies a types.Object
// An Encoder amortizes the cost of encoding the paths of multiple objects.
// The zero value of an Encoder is ready to use.
type Encoder struct {
- scopeMemo map[*types.Scope][]types.Object // memoization of scopeObjects
- namedMethodsMemo map[*types.Named][]*types.Func // memoization of namedMethods()
- skipMethodSorting bool
-}
-
-// Expose back doors so that gopls can avoid method sorting, which can dominate
-// analysis on certain repositories.
-//
-// TODO(golang/go#61443): remove this.
-func init() {
- typesinternal.SkipEncoderMethodSorting = func(enc interface{}) {
- enc.(*Encoder).skipMethodSorting = true
- }
- typesinternal.ObjectpathObject = object
+ scopeMemo map[*types.Scope][]types.Object // memoization of scopeObjects
}
// For returns the path to an object relative to its package,
// Inspect declared methods of defined types.
if T, ok := o.Type().(*types.Named); ok {
path = append(path, opType)
- if !enc.skipMethodSorting {
- // Note that method index here is always with respect
- // to canonical ordering of methods, regardless of how
- // they appear in the underlying type.
- for i, m := range enc.namedMethods(T) {
- path2 := appendOpArg(path, opMethod, i)
- if m == obj {
- return Path(path2), nil // found declared method
- }
- if r := find(obj, m.Type(), append(path2, opType), nil); r != nil {
- return Path(r), nil
- }
+ // The method index here is always with respect
+ // to the underlying go/types data structures,
+ // which ultimately derives from source order
+ // and must be preserved by export data.
+ for i := 0; i < T.NumMethods(); i++ {
+ m := T.Method(i)
+ path2 := appendOpArg(path, opMethod, i)
+ if m == obj {
+ return Path(path2), nil // found declared method
}
- } else {
- // This branch must match the logic in the branch above, using go/types
- // APIs without sorting.
- for i := 0; i < T.NumMethods(); i++ {
- m := T.Method(i)
- path2 := appendOpArg(path, opMethod, i)
- if m == obj {
- return Path(path2), nil // found declared method
- }
- if r := find(obj, m.Type(), append(path2, opType), nil); r != nil {
- return Path(r), nil
- }
+ if r := find(obj, m.Type(), append(path2, opType), nil); r != nil {
+ return Path(r), nil
}
}
}
path = append(path, name...)
path = append(path, opType)
- if !enc.skipMethodSorting {
- for i, m := range enc.namedMethods(named) {
- if m == meth {
- path = appendOpArg(path, opMethod, i)
- return Path(path), true
- }
- }
- } else {
- // This branch must match the logic of the branch above, using go/types
- // APIs without sorting.
- for i := 0; i < named.NumMethods(); i++ {
- m := named.Method(i)
- if m == meth {
- path = appendOpArg(path, opMethod, i)
- return Path(path), true
- }
+ // Method indices are w.r.t. the go/types data structures,
+ // ultimately deriving from source order,
+ // which is preserved by export data.
+ for i := 0; i < named.NumMethods(); i++ {
+ if named.Method(i) == meth {
+ path = appendOpArg(path, opMethod, i)
+ return Path(path), true
}
}
// Object returns the object denoted by path p within the package pkg.
func Object(pkg *types.Package, p Path) (types.Object, error) {
- return object(pkg, string(p), false)
-}
-
-// Note: the skipMethodSorting parameter must match the value of
-// Encoder.skipMethodSorting used during encoding.
-func object(pkg *types.Package, pathstr string, skipMethodSorting bool) (types.Object, error) {
+ pathstr := string(p)
if pathstr == "" {
return nil, fmt.Errorf("empty path")
}
if index >= t.NumMethods() {
return nil, fmt.Errorf("method index %d out of range [0-%d)", index, t.NumMethods())
}
- if skipMethodSorting {
- obj = t.Method(index)
- } else {
- methods := namedMethods(t) // (unmemoized)
- obj = methods[index] // Id-ordered
- }
+ obj = t.Method(index)
default:
return nil, fmt.Errorf("cannot apply %q to %s (got %T, want interface or named)", code, t, t)
return obj, nil // success
}
-// namedMethods returns the methods of a Named type in ascending Id order.
-func namedMethods(named *types.Named) []*types.Func {
- methods := make([]*types.Func, named.NumMethods())
- for i := range methods {
- methods[i] = named.Method(i)
- }
- sort.Slice(methods, func(i, j int) bool {
- return methods[i].Id() < methods[j].Id()
- })
- return methods
-}
-
-// namedMethods is a memoization of the namedMethods function. Callers must not modify the result.
-func (enc *Encoder) namedMethods(named *types.Named) []*types.Func {
- m := enc.namedMethodsMemo
- if m == nil {
- m = make(map[*types.Named][]*types.Func)
- enc.namedMethodsMemo = m
- }
- methods, ok := m[named]
- if !ok {
- methods = namedMethods(named) // allocates and sorts
- m[named] = methods
- }
- return methods
-}
-
// scopeObjects is a memoization of scope objects.
// Callers must not modify the result.
func (enc *Encoder) scopeObjects(scope *types.Scope) []types.Object {
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/types/objectpath"
- "golang.org/x/tools/internal/typesinternal"
)
const debug = false
//
// Concurrent calls to Decode are safe, so long as the
// [GetPackageFunc] (if any) is also concurrency-safe.
-//
-// TODO(golang/go#61443): eliminate skipMethodSorting one way or the other.
-func (d *Decoder) Decode(skipMethodSorting bool, read func(pkgPath string) ([]byte, error)) (*Set, error) {
+func (d *Decoder) Decode(read func(pkgPath string) ([]byte, error)) (*Set, error) {
// Read facts from imported packages.
// Facts may describe indirectly imported packages, or their objects.
m := make(map[key]analysis.Fact) // one big bucket
key := key{pkg: factPkg, t: reflect.TypeOf(f.Fact)}
if f.Object != "" {
// object fact
- obj, err := typesinternal.ObjectpathObject(factPkg, string(f.Object), skipMethodSorting)
+ obj, err := objectpath.Object(factPkg, f.Object)
if err != nil {
// (most likely due to unexported object)
// TODO(adonovan): audit for other possibilities.
//
// It may fail if one of the Facts could not be gob-encoded, but this is
// a sign of a bug in an Analyzer.
-func (s *Set) Encode(skipMethodSorting bool) []byte {
+func (s *Set) Encode() []byte {
encoder := new(objectpath.Encoder)
- if skipMethodSorting {
- typesinternal.SkipEncoderMethodSorting(encoder)
- }
// TODO(adonovan): opt: use a more efficient encoding
// that avoids repeating PkgPath for each fact.
+++ /dev/null
-// Copyright 2020 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
-
-//go:generate stringer -type=ErrorCode
-
-type ErrorCode int
-
-// This file defines the error codes that can be produced during type-checking.
-// Collectively, these codes provide an identifier that may be used to
-// implement special handling for certain types of errors.
-//
-// Error codes should be fine-grained enough that the exact nature of the error
-// can be easily determined, but coarse enough that they are not an
-// implementation detail of the type checking algorithm. As a rule-of-thumb,
-// errors should be considered equivalent if there is a theoretical refactoring
-// of the type checker in which they are emitted in exactly one place. For
-// example, the type checker emits different error messages for "too many
-// arguments" and "too few arguments", but one can imagine an alternative type
-// checker where this check instead just emits a single "wrong number of
-// arguments", so these errors should have the same code.
-//
-// Error code names should be as brief as possible while retaining accuracy and
-// distinctiveness. In most cases names should start with an adjective
-// describing the nature of the error (e.g. "invalid", "unused", "misplaced"),
-// and end with a noun identifying the relevant language object. For example,
-// "DuplicateDecl" or "InvalidSliceExpr". For brevity, naming follows the
-// convention that "bad" implies a problem with syntax, and "invalid" implies a
-// problem with types.
-
-const (
- // InvalidSyntaxTree occurs if an invalid syntax tree is provided
- // to the type checker. It should never happen.
- InvalidSyntaxTree ErrorCode = -1
-)
-
-const (
- _ ErrorCode = iota
-
- // Test is reserved for errors that only apply while in self-test mode.
- Test
-
- /* package names */
-
- // BlankPkgName occurs when a package name is the blank identifier "_".
- //
- // Per the spec:
- // "The PackageName must not be the blank identifier."
- BlankPkgName
-
- // MismatchedPkgName occurs when a file's package name doesn't match the
- // package name already established by other files.
- MismatchedPkgName
-
- // InvalidPkgUse occurs when a package identifier is used outside of a
- // selector expression.
- //
- // Example:
- // import "fmt"
- //
- // var _ = fmt
- InvalidPkgUse
-
- /* imports */
-
- // BadImportPath occurs when an import path is not valid.
- BadImportPath
-
- // BrokenImport occurs when importing a package fails.
- //
- // Example:
- // import "amissingpackage"
- BrokenImport
-
- // ImportCRenamed occurs when the special import "C" is renamed. "C" is a
- // pseudo-package, and must not be renamed.
- //
- // Example:
- // import _ "C"
- ImportCRenamed
-
- // UnusedImport occurs when an import is unused.
- //
- // Example:
- // import "fmt"
- //
- // func main() {}
- UnusedImport
-
- /* initialization */
-
- // InvalidInitCycle occurs when an invalid cycle is detected within the
- // initialization graph.
- //
- // Example:
- // var x int = f()
- //
- // func f() int { return x }
- InvalidInitCycle
-
- /* decls */
-
- // DuplicateDecl occurs when an identifier is declared multiple times.
- //
- // Example:
- // var x = 1
- // var x = 2
- DuplicateDecl
-
- // InvalidDeclCycle occurs when a declaration cycle is not valid.
- //
- // Example:
- // import "unsafe"
- //
- // type T struct {
- // a [n]int
- // }
- //
- // var n = unsafe.Sizeof(T{})
- InvalidDeclCycle
-
- // InvalidTypeCycle occurs when a cycle in type definitions results in a
- // type that is not well-defined.
- //
- // Example:
- // import "unsafe"
- //
- // type T [unsafe.Sizeof(T{})]int
- InvalidTypeCycle
-
- /* decls > const */
-
- // InvalidConstInit occurs when a const declaration has a non-constant
- // initializer.
- //
- // Example:
- // var x int
- // const _ = x
- InvalidConstInit
-
- // InvalidConstVal occurs when a const value cannot be converted to its
- // target type.
- //
- // TODO(findleyr): this error code and example are not very clear. Consider
- // removing it.
- //
- // Example:
- // const _ = 1 << "hello"
- InvalidConstVal
-
- // InvalidConstType occurs when the underlying type in a const declaration
- // is not a valid constant type.
- //
- // Example:
- // const c *int = 4
- InvalidConstType
-
- /* decls > var (+ other variable assignment codes) */
-
- // UntypedNilUse occurs when the predeclared (untyped) value nil is used to
- // initialize a variable declared without an explicit type.
- //
- // Example:
- // var x = nil
- UntypedNilUse
-
- // WrongAssignCount occurs when the number of values on the right-hand side
- // of an assignment or or initialization expression does not match the number
- // of variables on the left-hand side.
- //
- // Example:
- // var x = 1, 2
- WrongAssignCount
-
- // UnassignableOperand occurs when the left-hand side of an assignment is
- // not assignable.
- //
- // Example:
- // func f() {
- // const c = 1
- // c = 2
- // }
- UnassignableOperand
-
- // NoNewVar occurs when a short variable declaration (':=') does not declare
- // new variables.
- //
- // Example:
- // func f() {
- // x := 1
- // x := 2
- // }
- NoNewVar
-
- // MultiValAssignOp occurs when an assignment operation (+=, *=, etc) does
- // not have single-valued left-hand or right-hand side.
- //
- // Per the spec:
- // "In assignment operations, both the left- and right-hand expression lists
- // must contain exactly one single-valued expression"
- //
- // Example:
- // func f() int {
- // x, y := 1, 2
- // x, y += 1
- // return x + y
- // }
- MultiValAssignOp
-
- // InvalidIfaceAssign occurs when a value of type T is used as an
- // interface, but T does not implement a method of the expected interface.
- //
- // Example:
- // type I interface {
- // f()
- // }
- //
- // type T int
- //
- // var x I = T(1)
- InvalidIfaceAssign
-
- // InvalidChanAssign occurs when a chan assignment is invalid.
- //
- // Per the spec, a value x is assignable to a channel type T if:
- // "x is a bidirectional channel value, T is a channel type, x's type V and
- // T have identical element types, and at least one of V or T is not a
- // defined type."
- //
- // Example:
- // type T1 chan int
- // type T2 chan int
- //
- // var x T1
- // // Invalid assignment because both types are named
- // var _ T2 = x
- InvalidChanAssign
-
- // IncompatibleAssign occurs when the type of the right-hand side expression
- // in an assignment cannot be assigned to the type of the variable being
- // assigned.
- //
- // Example:
- // var x []int
- // var _ int = x
- IncompatibleAssign
-
- // UnaddressableFieldAssign occurs when trying to assign to a struct field
- // in a map value.
- //
- // Example:
- // func f() {
- // m := make(map[string]struct{i int})
- // m["foo"].i = 42
- // }
- UnaddressableFieldAssign
-
- /* decls > type (+ other type expression codes) */
-
- // NotAType occurs when the identifier used as the underlying type in a type
- // declaration or the right-hand side of a type alias does not denote a type.
- //
- // Example:
- // var S = 2
- //
- // type T S
- NotAType
-
- // InvalidArrayLen occurs when an array length is not a constant value.
- //
- // Example:
- // var n = 3
- // var _ = [n]int{}
- InvalidArrayLen
-
- // BlankIfaceMethod occurs when a method name is '_'.
- //
- // Per the spec:
- // "The name of each explicitly specified method must be unique and not
- // blank."
- //
- // Example:
- // type T interface {
- // _(int)
- // }
- BlankIfaceMethod
-
- // IncomparableMapKey occurs when a map key type does not support the == and
- // != operators.
- //
- // Per the spec:
- // "The comparison operators == and != must be fully defined for operands of
- // the key type; thus the key type must not be a function, map, or slice."
- //
- // Example:
- // var x map[T]int
- //
- // type T []int
- IncomparableMapKey
-
- // InvalidIfaceEmbed occurs when a non-interface type is embedded in an
- // interface.
- //
- // Example:
- // type T struct {}
- //
- // func (T) m()
- //
- // type I interface {
- // T
- // }
- InvalidIfaceEmbed
-
- // InvalidPtrEmbed occurs when an embedded field is of the pointer form *T,
- // and T itself is itself a pointer, an unsafe.Pointer, or an interface.
- //
- // Per the spec:
- // "An embedded field must be specified as a type name T or as a pointer to
- // a non-interface type name *T, and T itself may not be a pointer type."
- //
- // Example:
- // type T *int
- //
- // type S struct {
- // *T
- // }
- InvalidPtrEmbed
-
- /* decls > func and method */
-
- // BadRecv occurs when a method declaration does not have exactly one
- // receiver parameter.
- //
- // Example:
- // func () _() {}
- BadRecv
-
- // InvalidRecv occurs when a receiver type expression is not of the form T
- // or *T, or T is a pointer type.
- //
- // Example:
- // type T struct {}
- //
- // func (**T) m() {}
- InvalidRecv
-
- // DuplicateFieldAndMethod occurs when an identifier appears as both a field
- // and method name.
- //
- // Example:
- // type T struct {
- // m int
- // }
- //
- // func (T) m() {}
- DuplicateFieldAndMethod
-
- // DuplicateMethod occurs when two methods on the same receiver type have
- // the same name.
- //
- // Example:
- // type T struct {}
- // func (T) m() {}
- // func (T) m(i int) int { return i }
- DuplicateMethod
-
- /* decls > special */
-
- // InvalidBlank occurs when a blank identifier is used as a value or type.
- //
- // Per the spec:
- // "The blank identifier may appear as an operand only on the left-hand side
- // of an assignment."
- //
- // Example:
- // var x = _
- InvalidBlank
-
- // InvalidIota occurs when the predeclared identifier iota is used outside
- // of a constant declaration.
- //
- // Example:
- // var x = iota
- InvalidIota
-
- // MissingInitBody occurs when an init function is missing its body.
- //
- // Example:
- // func init()
- MissingInitBody
-
- // InvalidInitSig occurs when an init function declares parameters or
- // results.
- //
- // Example:
- // func init() int { return 1 }
- InvalidInitSig
-
- // InvalidInitDecl occurs when init is declared as anything other than a
- // function.
- //
- // Example:
- // var init = 1
- InvalidInitDecl
-
- // InvalidMainDecl occurs when main is declared as anything other than a
- // function, in a main package.
- InvalidMainDecl
-
- /* exprs */
-
- // TooManyValues occurs when a function returns too many values for the
- // expression context in which it is used.
- //
- // Example:
- // func ReturnTwo() (int, int) {
- // return 1, 2
- // }
- //
- // var x = ReturnTwo()
- TooManyValues
-
- // NotAnExpr occurs when a type expression is used where a value expression
- // is expected.
- //
- // Example:
- // type T struct {}
- //
- // func f() {
- // T
- // }
- NotAnExpr
-
- /* exprs > const */
-
- // TruncatedFloat occurs when a float constant is truncated to an integer
- // value.
- //
- // Example:
- // var _ int = 98.6
- TruncatedFloat
-
- // NumericOverflow occurs when a numeric constant overflows its target type.
- //
- // Example:
- // var x int8 = 1000
- NumericOverflow
-
- /* exprs > operation */
-
- // UndefinedOp occurs when an operator is not defined for the type(s) used
- // in an operation.
- //
- // Example:
- // var c = "a" - "b"
- UndefinedOp
-
- // MismatchedTypes occurs when operand types are incompatible in a binary
- // operation.
- //
- // Example:
- // var a = "hello"
- // var b = 1
- // var c = a - b
- MismatchedTypes
-
- // DivByZero occurs when a division operation is provable at compile
- // time to be a division by zero.
- //
- // Example:
- // const divisor = 0
- // var x int = 1/divisor
- DivByZero
-
- // NonNumericIncDec occurs when an increment or decrement operator is
- // applied to a non-numeric value.
- //
- // Example:
- // func f() {
- // var c = "c"
- // c++
- // }
- NonNumericIncDec
-
- /* exprs > ptr */
-
- // UnaddressableOperand occurs when the & operator is applied to an
- // unaddressable expression.
- //
- // Example:
- // var x = &1
- UnaddressableOperand
-
- // InvalidIndirection occurs when a non-pointer value is indirected via the
- // '*' operator.
- //
- // Example:
- // var x int
- // var y = *x
- InvalidIndirection
-
- /* exprs > [] */
-
- // NonIndexableOperand occurs when an index operation is applied to a value
- // that cannot be indexed.
- //
- // Example:
- // var x = 1
- // var y = x[1]
- NonIndexableOperand
-
- // InvalidIndex occurs when an index argument is not of integer type,
- // negative, or out-of-bounds.
- //
- // Example:
- // var s = [...]int{1,2,3}
- // var x = s[5]
- //
- // Example:
- // var s = []int{1,2,3}
- // var _ = s[-1]
- //
- // Example:
- // var s = []int{1,2,3}
- // var i string
- // var _ = s[i]
- InvalidIndex
-
- // SwappedSliceIndices occurs when constant indices in a slice expression
- // are decreasing in value.
- //
- // Example:
- // var _ = []int{1,2,3}[2:1]
- SwappedSliceIndices
-
- /* operators > slice */
-
- // NonSliceableOperand occurs when a slice operation is applied to a value
- // whose type is not sliceable, or is unaddressable.
- //
- // Example:
- // var x = [...]int{1, 2, 3}[:1]
- //
- // Example:
- // var x = 1
- // var y = 1[:1]
- NonSliceableOperand
-
- // InvalidSliceExpr occurs when a three-index slice expression (a[x:y:z]) is
- // applied to a string.
- //
- // Example:
- // var s = "hello"
- // var x = s[1:2:3]
- InvalidSliceExpr
-
- /* exprs > shift */
-
- // InvalidShiftCount occurs when the right-hand side of a shift operation is
- // either non-integer, negative, or too large.
- //
- // Example:
- // var (
- // x string
- // y int = 1 << x
- // )
- InvalidShiftCount
-
- // InvalidShiftOperand occurs when the shifted operand is not an integer.
- //
- // Example:
- // var s = "hello"
- // var x = s << 2
- InvalidShiftOperand
-
- /* exprs > chan */
-
- // InvalidReceive occurs when there is a channel receive from a value that
- // is either not a channel, or is a send-only channel.
- //
- // Example:
- // func f() {
- // var x = 1
- // <-x
- // }
- InvalidReceive
-
- // InvalidSend occurs when there is a channel send to a value that is not a
- // channel, or is a receive-only channel.
- //
- // Example:
- // func f() {
- // var x = 1
- // x <- "hello!"
- // }
- InvalidSend
-
- /* exprs > literal */
-
- // DuplicateLitKey occurs when an index is duplicated in a slice, array, or
- // map literal.
- //
- // Example:
- // var _ = []int{0:1, 0:2}
- //
- // Example:
- // var _ = map[string]int{"a": 1, "a": 2}
- DuplicateLitKey
-
- // MissingLitKey occurs when a map literal is missing a key expression.
- //
- // Example:
- // var _ = map[string]int{1}
- MissingLitKey
-
- // InvalidLitIndex occurs when the key in a key-value element of a slice or
- // array literal is not an integer constant.
- //
- // Example:
- // var i = 0
- // var x = []string{i: "world"}
- InvalidLitIndex
-
- // OversizeArrayLit occurs when an array literal exceeds its length.
- //
- // Example:
- // var _ = [2]int{1,2,3}
- OversizeArrayLit
-
- // MixedStructLit occurs when a struct literal contains a mix of positional
- // and named elements.
- //
- // Example:
- // var _ = struct{i, j int}{i: 1, 2}
- MixedStructLit
-
- // InvalidStructLit occurs when a positional struct literal has an incorrect
- // number of values.
- //
- // Example:
- // var _ = struct{i, j int}{1,2,3}
- InvalidStructLit
-
- // MissingLitField occurs when a struct literal refers to a field that does
- // not exist on the struct type.
- //
- // Example:
- // var _ = struct{i int}{j: 2}
- MissingLitField
-
- // DuplicateLitField occurs when a struct literal contains duplicated
- // fields.
- //
- // Example:
- // var _ = struct{i int}{i: 1, i: 2}
- DuplicateLitField
-
- // UnexportedLitField occurs when a positional struct literal implicitly
- // assigns an unexported field of an imported type.
- UnexportedLitField
-
- // InvalidLitField occurs when a field name is not a valid identifier.
- //
- // Example:
- // var _ = struct{i int}{1: 1}
- InvalidLitField
-
- // UntypedLit occurs when a composite literal omits a required type
- // identifier.
- //
- // Example:
- // type outer struct{
- // inner struct { i int }
- // }
- //
- // var _ = outer{inner: {1}}
- UntypedLit
-
- // InvalidLit occurs when a composite literal expression does not match its
- // type.
- //
- // Example:
- // type P *struct{
- // x int
- // }
- // var _ = P {}
- InvalidLit
-
- /* exprs > selector */
-
- // AmbiguousSelector occurs when a selector is ambiguous.
- //
- // Example:
- // type E1 struct { i int }
- // type E2 struct { i int }
- // type T struct { E1; E2 }
- //
- // var x T
- // var _ = x.i
- AmbiguousSelector
-
- // UndeclaredImportedName occurs when a package-qualified identifier is
- // undeclared by the imported package.
- //
- // Example:
- // import "go/types"
- //
- // var _ = types.NotAnActualIdentifier
- UndeclaredImportedName
-
- // UnexportedName occurs when a selector refers to an unexported identifier
- // of an imported package.
- //
- // Example:
- // import "reflect"
- //
- // type _ reflect.flag
- UnexportedName
-
- // UndeclaredName occurs when an identifier is not declared in the current
- // scope.
- //
- // Example:
- // var x T
- UndeclaredName
-
- // MissingFieldOrMethod occurs when a selector references a field or method
- // that does not exist.
- //
- // Example:
- // type T struct {}
- //
- // var x = T{}.f
- MissingFieldOrMethod
-
- /* exprs > ... */
-
- // BadDotDotDotSyntax occurs when a "..." occurs in a context where it is
- // not valid.
- //
- // Example:
- // var _ = map[int][...]int{0: {}}
- BadDotDotDotSyntax
-
- // NonVariadicDotDotDot occurs when a "..." is used on the final argument to
- // a non-variadic function.
- //
- // Example:
- // func printArgs(s []string) {
- // for _, a := range s {
- // println(a)
- // }
- // }
- //
- // func f() {
- // s := []string{"a", "b", "c"}
- // printArgs(s...)
- // }
- NonVariadicDotDotDot
-
- // MisplacedDotDotDot occurs when a "..." is used somewhere other than the
- // final argument to a function call.
- //
- // Example:
- // func printArgs(args ...int) {
- // for _, a := range args {
- // println(a)
- // }
- // }
- //
- // func f() {
- // a := []int{1,2,3}
- // printArgs(0, a...)
- // }
- MisplacedDotDotDot
-
- // InvalidDotDotDotOperand occurs when a "..." operator is applied to a
- // single-valued operand.
- //
- // Example:
- // func printArgs(args ...int) {
- // for _, a := range args {
- // println(a)
- // }
- // }
- //
- // func f() {
- // a := 1
- // printArgs(a...)
- // }
- //
- // Example:
- // func args() (int, int) {
- // return 1, 2
- // }
- //
- // func printArgs(args ...int) {
- // for _, a := range args {
- // println(a)
- // }
- // }
- //
- // func g() {
- // printArgs(args()...)
- // }
- InvalidDotDotDotOperand
-
- // InvalidDotDotDot occurs when a "..." is used in a non-variadic built-in
- // function.
- //
- // Example:
- // var s = []int{1, 2, 3}
- // var l = len(s...)
- InvalidDotDotDot
-
- /* exprs > built-in */
-
- // UncalledBuiltin occurs when a built-in function is used as a
- // function-valued expression, instead of being called.
- //
- // Per the spec:
- // "The built-in functions do not have standard Go types, so they can only
- // appear in call expressions; they cannot be used as function values."
- //
- // Example:
- // var _ = copy
- UncalledBuiltin
-
- // InvalidAppend occurs when append is called with a first argument that is
- // not a slice.
- //
- // Example:
- // var _ = append(1, 2)
- InvalidAppend
-
- // InvalidCap occurs when an argument to the cap built-in function is not of
- // supported type.
- //
- // See https://golang.org/ref/spec#Lengthand_capacity for information on
- // which underlying types are supported as arguments to cap and len.
- //
- // Example:
- // var s = 2
- // var x = cap(s)
- InvalidCap
-
- // InvalidClose occurs when close(...) is called with an argument that is
- // not of channel type, or that is a receive-only channel.
- //
- // Example:
- // func f() {
- // var x int
- // close(x)
- // }
- InvalidClose
-
- // InvalidCopy occurs when the arguments are not of slice type or do not
- // have compatible type.
- //
- // See https://golang.org/ref/spec#Appendingand_copying_slices for more
- // information on the type requirements for the copy built-in.
- //
- // Example:
- // func f() {
- // var x []int
- // y := []int64{1,2,3}
- // copy(x, y)
- // }
- InvalidCopy
-
- // InvalidComplex occurs when the complex built-in function is called with
- // arguments with incompatible types.
- //
- // Example:
- // var _ = complex(float32(1), float64(2))
- InvalidComplex
-
- // InvalidDelete occurs when the delete built-in function is called with a
- // first argument that is not a map.
- //
- // Example:
- // func f() {
- // m := "hello"
- // delete(m, "e")
- // }
- InvalidDelete
-
- // InvalidImag occurs when the imag built-in function is called with an
- // argument that does not have complex type.
- //
- // Example:
- // var _ = imag(int(1))
- InvalidImag
-
- // InvalidLen occurs when an argument to the len built-in function is not of
- // supported type.
- //
- // See https://golang.org/ref/spec#Lengthand_capacity for information on
- // which underlying types are supported as arguments to cap and len.
- //
- // Example:
- // var s = 2
- // var x = len(s)
- InvalidLen
-
- // SwappedMakeArgs occurs when make is called with three arguments, and its
- // length argument is larger than its capacity argument.
- //
- // Example:
- // var x = make([]int, 3, 2)
- SwappedMakeArgs
-
- // InvalidMake occurs when make is called with an unsupported type argument.
- //
- // See https://golang.org/ref/spec#Makingslices_maps_and_channels for
- // information on the types that may be created using make.
- //
- // Example:
- // var x = make(int)
- InvalidMake
-
- // InvalidReal occurs when the real built-in function is called with an
- // argument that does not have complex type.
- //
- // Example:
- // var _ = real(int(1))
- InvalidReal
-
- /* exprs > assertion */
-
- // InvalidAssert occurs when a type assertion is applied to a
- // value that is not of interface type.
- //
- // Example:
- // var x = 1
- // var _ = x.(float64)
- InvalidAssert
-
- // ImpossibleAssert occurs for a type assertion x.(T) when the value x of
- // interface cannot have dynamic type T, due to a missing or mismatching
- // method on T.
- //
- // Example:
- // type T int
- //
- // func (t *T) m() int { return int(*t) }
- //
- // type I interface { m() int }
- //
- // var x I
- // var _ = x.(T)
- ImpossibleAssert
-
- /* exprs > conversion */
-
- // InvalidConversion occurs when the argument type cannot be converted to the
- // target.
- //
- // See https://golang.org/ref/spec#Conversions for the rules of
- // convertibility.
- //
- // Example:
- // var x float64
- // var _ = string(x)
- InvalidConversion
-
- // InvalidUntypedConversion occurs when an there is no valid implicit
- // conversion from an untyped value satisfying the type constraints of the
- // context in which it is used.
- //
- // Example:
- // var _ = 1 + ""
- InvalidUntypedConversion
-
- /* offsetof */
-
- // BadOffsetofSyntax occurs when unsafe.Offsetof is called with an argument
- // that is not a selector expression.
- //
- // Example:
- // import "unsafe"
- //
- // var x int
- // var _ = unsafe.Offsetof(x)
- BadOffsetofSyntax
-
- // InvalidOffsetof occurs when unsafe.Offsetof is called with a method
- // selector, rather than a field selector, or when the field is embedded via
- // a pointer.
- //
- // Per the spec:
- //
- // "If f is an embedded field, it must be reachable without pointer
- // indirections through fields of the struct. "
- //
- // Example:
- // import "unsafe"
- //
- // type T struct { f int }
- // type S struct { *T }
- // var s S
- // var _ = unsafe.Offsetof(s.f)
- //
- // Example:
- // import "unsafe"
- //
- // type S struct{}
- //
- // func (S) m() {}
- //
- // var s S
- // var _ = unsafe.Offsetof(s.m)
- InvalidOffsetof
-
- /* control flow > scope */
-
- // UnusedExpr occurs when a side-effect free expression is used as a
- // statement. Such a statement has no effect.
- //
- // Example:
- // func f(i int) {
- // i*i
- // }
- UnusedExpr
-
- // UnusedVar occurs when a variable is declared but unused.
- //
- // Example:
- // func f() {
- // x := 1
- // }
- UnusedVar
-
- // MissingReturn occurs when a function with results is missing a return
- // statement.
- //
- // Example:
- // func f() int {}
- MissingReturn
-
- // WrongResultCount occurs when a return statement returns an incorrect
- // number of values.
- //
- // Example:
- // func ReturnOne() int {
- // return 1, 2
- // }
- WrongResultCount
-
- // OutOfScopeResult occurs when the name of a value implicitly returned by
- // an empty return statement is shadowed in a nested scope.
- //
- // Example:
- // func factor(n int) (i int) {
- // for i := 2; i < n; i++ {
- // if n%i == 0 {
- // return
- // }
- // }
- // return 0
- // }
- OutOfScopeResult
-
- /* control flow > if */
-
- // InvalidCond occurs when an if condition is not a boolean expression.
- //
- // Example:
- // func checkReturn(i int) {
- // if i {
- // panic("non-zero return")
- // }
- // }
- InvalidCond
-
- /* control flow > for */
-
- // InvalidPostDecl occurs when there is a declaration in a for-loop post
- // statement.
- //
- // Example:
- // func f() {
- // for i := 0; i < 10; j := 0 {}
- // }
- InvalidPostDecl
-
- // InvalidChanRange occurs when a send-only channel used in a range
- // expression.
- //
- // Example:
- // func sum(c chan<- int) {
- // s := 0
- // for i := range c {
- // s += i
- // }
- // }
- InvalidChanRange
-
- // InvalidIterVar occurs when two iteration variables are used while ranging
- // over a channel.
- //
- // Example:
- // func f(c chan int) {
- // for k, v := range c {
- // println(k, v)
- // }
- // }
- InvalidIterVar
-
- // InvalidRangeExpr occurs when the type of a range expression is not array,
- // slice, string, map, or channel.
- //
- // Example:
- // func f(i int) {
- // for j := range i {
- // println(j)
- // }
- // }
- InvalidRangeExpr
-
- /* control flow > switch */
-
- // MisplacedBreak occurs when a break statement is not within a for, switch,
- // or select statement of the innermost function definition.
- //
- // Example:
- // func f() {
- // break
- // }
- MisplacedBreak
-
- // MisplacedContinue occurs when a continue statement is not within a for
- // loop of the innermost function definition.
- //
- // Example:
- // func sumeven(n int) int {
- // proceed := func() {
- // continue
- // }
- // sum := 0
- // for i := 1; i <= n; i++ {
- // if i % 2 != 0 {
- // proceed()
- // }
- // sum += i
- // }
- // return sum
- // }
- MisplacedContinue
-
- // MisplacedFallthrough occurs when a fallthrough statement is not within an
- // expression switch.
- //
- // Example:
- // func typename(i interface{}) string {
- // switch i.(type) {
- // case int64:
- // fallthrough
- // case int:
- // return "int"
- // }
- // return "unsupported"
- // }
- MisplacedFallthrough
-
- // DuplicateCase occurs when a type or expression switch has duplicate
- // cases.
- //
- // Example:
- // func printInt(i int) {
- // switch i {
- // case 1:
- // println("one")
- // case 1:
- // println("One")
- // }
- // }
- DuplicateCase
-
- // DuplicateDefault occurs when a type or expression switch has multiple
- // default clauses.
- //
- // Example:
- // func printInt(i int) {
- // switch i {
- // case 1:
- // println("one")
- // default:
- // println("One")
- // default:
- // println("1")
- // }
- // }
- DuplicateDefault
-
- // BadTypeKeyword occurs when a .(type) expression is used anywhere other
- // than a type switch.
- //
- // Example:
- // type I interface {
- // m()
- // }
- // var t I
- // var _ = t.(type)
- BadTypeKeyword
-
- // InvalidTypeSwitch occurs when .(type) is used on an expression that is
- // not of interface type.
- //
- // Example:
- // func f(i int) {
- // switch x := i.(type) {}
- // }
- InvalidTypeSwitch
-
- // InvalidExprSwitch occurs when a switch expression is not comparable.
- //
- // Example:
- // func _() {
- // var a struct{ _ func() }
- // switch a /* ERROR cannot switch on a */ {
- // }
- // }
- InvalidExprSwitch
-
- /* control flow > select */
-
- // InvalidSelectCase occurs when a select case is not a channel send or
- // receive.
- //
- // Example:
- // func checkChan(c <-chan int) bool {
- // select {
- // case c:
- // return true
- // default:
- // return false
- // }
- // }
- InvalidSelectCase
-
- /* control flow > labels and jumps */
-
- // UndeclaredLabel occurs when an undeclared label is jumped to.
- //
- // Example:
- // func f() {
- // goto L
- // }
- UndeclaredLabel
-
- // DuplicateLabel occurs when a label is declared more than once.
- //
- // Example:
- // func f() int {
- // L:
- // L:
- // return 1
- // }
- DuplicateLabel
-
- // MisplacedLabel occurs when a break or continue label is not on a for,
- // switch, or select statement.
- //
- // Example:
- // func f() {
- // L:
- // a := []int{1,2,3}
- // for _, e := range a {
- // if e > 10 {
- // break L
- // }
- // println(a)
- // }
- // }
- MisplacedLabel
-
- // UnusedLabel occurs when a label is declared but not used.
- //
- // Example:
- // func f() {
- // L:
- // }
- UnusedLabel
-
- // JumpOverDecl occurs when a label jumps over a variable declaration.
- //
- // Example:
- // func f() int {
- // goto L
- // x := 2
- // L:
- // x++
- // return x
- // }
- JumpOverDecl
-
- // JumpIntoBlock occurs when a forward jump goes to a label inside a nested
- // block.
- //
- // Example:
- // func f(x int) {
- // goto L
- // if x > 0 {
- // L:
- // print("inside block")
- // }
- // }
- JumpIntoBlock
-
- /* control flow > calls */
-
- // InvalidMethodExpr occurs when a pointer method is called but the argument
- // is not addressable.
- //
- // Example:
- // type T struct {}
- //
- // func (*T) m() int { return 1 }
- //
- // var _ = T.m(T{})
- InvalidMethodExpr
-
- // WrongArgCount occurs when too few or too many arguments are passed by a
- // function call.
- //
- // Example:
- // func f(i int) {}
- // var x = f()
- WrongArgCount
-
- // InvalidCall occurs when an expression is called that is not of function
- // type.
- //
- // Example:
- // var x = "x"
- // var y = x()
- InvalidCall
-
- /* control flow > suspended */
-
- // UnusedResults occurs when a restricted expression-only built-in function
- // is suspended via go or defer. Such a suspension discards the results of
- // these side-effect free built-in functions, and therefore is ineffectual.
- //
- // Example:
- // func f(a []int) int {
- // defer len(a)
- // return i
- // }
- UnusedResults
-
- // InvalidDefer occurs when a deferred expression is not a function call,
- // for example if the expression is a type conversion.
- //
- // Example:
- // func f(i int) int {
- // defer int32(i)
- // return i
- // }
- InvalidDefer
-
- // InvalidGo occurs when a go expression is not a function call, for example
- // if the expression is a type conversion.
- //
- // Example:
- // func f(i int) int {
- // go int32(i)
- // return i
- // }
- InvalidGo
-
- // All codes below were added in Go 1.17.
-
- /* decl */
-
- // BadDecl occurs when a declaration has invalid syntax.
- BadDecl
-
- // RepeatedDecl occurs when an identifier occurs more than once on the left
- // hand side of a short variable declaration.
- //
- // Example:
- // func _() {
- // x, y, y := 1, 2, 3
- // }
- RepeatedDecl
-
- /* unsafe */
-
- // InvalidUnsafeAdd occurs when unsafe.Add is called with a
- // length argument that is not of integer type.
- //
- // Example:
- // import "unsafe"
- //
- // var p unsafe.Pointer
- // var _ = unsafe.Add(p, float64(1))
- InvalidUnsafeAdd
-
- // InvalidUnsafeSlice occurs when unsafe.Slice is called with a
- // pointer argument that is not of pointer type or a length argument
- // that is not of integer type, negative, or out of bounds.
- //
- // Example:
- // import "unsafe"
- //
- // var x int
- // var _ = unsafe.Slice(x, 1)
- //
- // Example:
- // import "unsafe"
- //
- // var x int
- // var _ = unsafe.Slice(&x, float64(1))
- //
- // Example:
- // import "unsafe"
- //
- // var x int
- // var _ = unsafe.Slice(&x, -1)
- //
- // Example:
- // import "unsafe"
- //
- // var x int
- // var _ = unsafe.Slice(&x, uint64(1) << 63)
- InvalidUnsafeSlice
-
- // All codes below were added in Go 1.18.
-
- /* features */
-
- // UnsupportedFeature occurs when a language feature is used that is not
- // supported at this Go version.
- UnsupportedFeature
-
- /* type params */
-
- // NotAGenericType occurs when a non-generic type is used where a generic
- // type is expected: in type or function instantiation.
- //
- // Example:
- // type T int
- //
- // var _ T[int]
- NotAGenericType
-
- // WrongTypeArgCount occurs when a type or function is instantiated with an
- // incorrent number of type arguments, including when a generic type or
- // function is used without instantiation.
- //
- // Errors inolving failed type inference are assigned other error codes.
- //
- // Example:
- // type T[p any] int
- //
- // var _ T[int, string]
- //
- // Example:
- // func f[T any]() {}
- //
- // var x = f
- WrongTypeArgCount
-
- // CannotInferTypeArgs occurs when type or function type argument inference
- // fails to infer all type arguments.
- //
- // Example:
- // func f[T any]() {}
- //
- // func _() {
- // f()
- // }
- //
- // Example:
- // type N[P, Q any] struct{}
- //
- // var _ N[int]
- CannotInferTypeArgs
-
- // InvalidTypeArg occurs when a type argument does not satisfy its
- // corresponding type parameter constraints.
- //
- // Example:
- // type T[P ~int] struct{}
- //
- // var _ T[string]
- InvalidTypeArg // arguments? InferenceFailed
-
- // InvalidInstanceCycle occurs when an invalid cycle is detected
- // within the instantiation graph.
- //
- // Example:
- // func f[T any]() { f[*T]() }
- InvalidInstanceCycle
-
- // InvalidUnion occurs when an embedded union or approximation element is
- // not valid.
- //
- // Example:
- // type _ interface {
- // ~int | interface{ m() }
- // }
- InvalidUnion
-
- // MisplacedConstraintIface occurs when a constraint-type interface is used
- // outside of constraint position.
- //
- // Example:
- // type I interface { ~int }
- //
- // var _ I
- MisplacedConstraintIface
-
- // InvalidMethodTypeParams occurs when methods have type parameters.
- //
- // It cannot be encountered with an AST parsed using go/parser.
- InvalidMethodTypeParams
-
- // MisplacedTypeParam occurs when a type parameter is used in a place where
- // it is not permitted.
- //
- // Example:
- // type T[P any] P
- //
- // Example:
- // type T[P any] struct{ *P }
- MisplacedTypeParam
-
- // InvalidUnsafeSliceData occurs when unsafe.SliceData is called with
- // an argument that is not of slice type. It also occurs if it is used
- // in a package compiled for a language version before go1.20.
- //
- // Example:
- // import "unsafe"
- //
- // var x int
- // var _ = unsafe.SliceData(x)
- InvalidUnsafeSliceData
-
- // InvalidUnsafeString occurs when unsafe.String is called with
- // a length argument that is not of integer type, negative, or
- // out of bounds. It also occurs if it is used in a package
- // compiled for a language version before go1.20.
- //
- // Example:
- // import "unsafe"
- //
- // var b [10]byte
- // var _ = unsafe.String(&b[0], -1)
- InvalidUnsafeString
-
- // InvalidUnsafeStringData occurs if it is used in a package
- // compiled for a language version before go1.20.
- _ // not used anymore
-
-)
+++ /dev/null
-// Code generated by "stringer -type=ErrorCode"; DO NOT EDIT.
-
-package typesinternal
-
-import "strconv"
-
-func _() {
- // An "invalid array index" compiler error signifies that the constant values have changed.
- // Re-run the stringer command to generate them again.
- var x [1]struct{}
- _ = x[InvalidSyntaxTree - -1]
- _ = x[Test-1]
- _ = x[BlankPkgName-2]
- _ = x[MismatchedPkgName-3]
- _ = x[InvalidPkgUse-4]
- _ = x[BadImportPath-5]
- _ = x[BrokenImport-6]
- _ = x[ImportCRenamed-7]
- _ = x[UnusedImport-8]
- _ = x[InvalidInitCycle-9]
- _ = x[DuplicateDecl-10]
- _ = x[InvalidDeclCycle-11]
- _ = x[InvalidTypeCycle-12]
- _ = x[InvalidConstInit-13]
- _ = x[InvalidConstVal-14]
- _ = x[InvalidConstType-15]
- _ = x[UntypedNilUse-16]
- _ = x[WrongAssignCount-17]
- _ = x[UnassignableOperand-18]
- _ = x[NoNewVar-19]
- _ = x[MultiValAssignOp-20]
- _ = x[InvalidIfaceAssign-21]
- _ = x[InvalidChanAssign-22]
- _ = x[IncompatibleAssign-23]
- _ = x[UnaddressableFieldAssign-24]
- _ = x[NotAType-25]
- _ = x[InvalidArrayLen-26]
- _ = x[BlankIfaceMethod-27]
- _ = x[IncomparableMapKey-28]
- _ = x[InvalidIfaceEmbed-29]
- _ = x[InvalidPtrEmbed-30]
- _ = x[BadRecv-31]
- _ = x[InvalidRecv-32]
- _ = x[DuplicateFieldAndMethod-33]
- _ = x[DuplicateMethod-34]
- _ = x[InvalidBlank-35]
- _ = x[InvalidIota-36]
- _ = x[MissingInitBody-37]
- _ = x[InvalidInitSig-38]
- _ = x[InvalidInitDecl-39]
- _ = x[InvalidMainDecl-40]
- _ = x[TooManyValues-41]
- _ = x[NotAnExpr-42]
- _ = x[TruncatedFloat-43]
- _ = x[NumericOverflow-44]
- _ = x[UndefinedOp-45]
- _ = x[MismatchedTypes-46]
- _ = x[DivByZero-47]
- _ = x[NonNumericIncDec-48]
- _ = x[UnaddressableOperand-49]
- _ = x[InvalidIndirection-50]
- _ = x[NonIndexableOperand-51]
- _ = x[InvalidIndex-52]
- _ = x[SwappedSliceIndices-53]
- _ = x[NonSliceableOperand-54]
- _ = x[InvalidSliceExpr-55]
- _ = x[InvalidShiftCount-56]
- _ = x[InvalidShiftOperand-57]
- _ = x[InvalidReceive-58]
- _ = x[InvalidSend-59]
- _ = x[DuplicateLitKey-60]
- _ = x[MissingLitKey-61]
- _ = x[InvalidLitIndex-62]
- _ = x[OversizeArrayLit-63]
- _ = x[MixedStructLit-64]
- _ = x[InvalidStructLit-65]
- _ = x[MissingLitField-66]
- _ = x[DuplicateLitField-67]
- _ = x[UnexportedLitField-68]
- _ = x[InvalidLitField-69]
- _ = x[UntypedLit-70]
- _ = x[InvalidLit-71]
- _ = x[AmbiguousSelector-72]
- _ = x[UndeclaredImportedName-73]
- _ = x[UnexportedName-74]
- _ = x[UndeclaredName-75]
- _ = x[MissingFieldOrMethod-76]
- _ = x[BadDotDotDotSyntax-77]
- _ = x[NonVariadicDotDotDot-78]
- _ = x[MisplacedDotDotDot-79]
- _ = x[InvalidDotDotDotOperand-80]
- _ = x[InvalidDotDotDot-81]
- _ = x[UncalledBuiltin-82]
- _ = x[InvalidAppend-83]
- _ = x[InvalidCap-84]
- _ = x[InvalidClose-85]
- _ = x[InvalidCopy-86]
- _ = x[InvalidComplex-87]
- _ = x[InvalidDelete-88]
- _ = x[InvalidImag-89]
- _ = x[InvalidLen-90]
- _ = x[SwappedMakeArgs-91]
- _ = x[InvalidMake-92]
- _ = x[InvalidReal-93]
- _ = x[InvalidAssert-94]
- _ = x[ImpossibleAssert-95]
- _ = x[InvalidConversion-96]
- _ = x[InvalidUntypedConversion-97]
- _ = x[BadOffsetofSyntax-98]
- _ = x[InvalidOffsetof-99]
- _ = x[UnusedExpr-100]
- _ = x[UnusedVar-101]
- _ = x[MissingReturn-102]
- _ = x[WrongResultCount-103]
- _ = x[OutOfScopeResult-104]
- _ = x[InvalidCond-105]
- _ = x[InvalidPostDecl-106]
- _ = x[InvalidChanRange-107]
- _ = x[InvalidIterVar-108]
- _ = x[InvalidRangeExpr-109]
- _ = x[MisplacedBreak-110]
- _ = x[MisplacedContinue-111]
- _ = x[MisplacedFallthrough-112]
- _ = x[DuplicateCase-113]
- _ = x[DuplicateDefault-114]
- _ = x[BadTypeKeyword-115]
- _ = x[InvalidTypeSwitch-116]
- _ = x[InvalidExprSwitch-117]
- _ = x[InvalidSelectCase-118]
- _ = x[UndeclaredLabel-119]
- _ = x[DuplicateLabel-120]
- _ = x[MisplacedLabel-121]
- _ = x[UnusedLabel-122]
- _ = x[JumpOverDecl-123]
- _ = x[JumpIntoBlock-124]
- _ = x[InvalidMethodExpr-125]
- _ = x[WrongArgCount-126]
- _ = x[InvalidCall-127]
- _ = x[UnusedResults-128]
- _ = x[InvalidDefer-129]
- _ = x[InvalidGo-130]
- _ = x[BadDecl-131]
- _ = x[RepeatedDecl-132]
- _ = x[InvalidUnsafeAdd-133]
- _ = x[InvalidUnsafeSlice-134]
- _ = x[UnsupportedFeature-135]
- _ = x[NotAGenericType-136]
- _ = x[WrongTypeArgCount-137]
- _ = x[CannotInferTypeArgs-138]
- _ = x[InvalidTypeArg-139]
- _ = x[InvalidInstanceCycle-140]
- _ = x[InvalidUnion-141]
- _ = x[MisplacedConstraintIface-142]
- _ = x[InvalidMethodTypeParams-143]
- _ = x[MisplacedTypeParam-144]
- _ = x[InvalidUnsafeSliceData-145]
- _ = x[InvalidUnsafeString-146]
-}
-
-const (
- _ErrorCode_name_0 = "InvalidSyntaxTree"
- _ErrorCode_name_1 = "TestBlankPkgNameMismatchedPkgNameInvalidPkgUseBadImportPathBrokenImportImportCRenamedUnusedImportInvalidInitCycleDuplicateDeclInvalidDeclCycleInvalidTypeCycleInvalidConstInitInvalidConstValInvalidConstTypeUntypedNilUseWrongAssignCountUnassignableOperandNoNewVarMultiValAssignOpInvalidIfaceAssignInvalidChanAssignIncompatibleAssignUnaddressableFieldAssignNotATypeInvalidArrayLenBlankIfaceMethodIncomparableMapKeyInvalidIfaceEmbedInvalidPtrEmbedBadRecvInvalidRecvDuplicateFieldAndMethodDuplicateMethodInvalidBlankInvalidIotaMissingInitBodyInvalidInitSigInvalidInitDeclInvalidMainDeclTooManyValuesNotAnExprTruncatedFloatNumericOverflowUndefinedOpMismatchedTypesDivByZeroNonNumericIncDecUnaddressableOperandInvalidIndirectionNonIndexableOperandInvalidIndexSwappedSliceIndicesNonSliceableOperandInvalidSliceExprInvalidShiftCountInvalidShiftOperandInvalidReceiveInvalidSendDuplicateLitKeyMissingLitKeyInvalidLitIndexOversizeArrayLitMixedStructLitInvalidStructLitMissingLitFieldDuplicateLitFieldUnexportedLitFieldInvalidLitFieldUntypedLitInvalidLitAmbiguousSelectorUndeclaredImportedNameUnexportedNameUndeclaredNameMissingFieldOrMethodBadDotDotDotSyntaxNonVariadicDotDotDotMisplacedDotDotDotInvalidDotDotDotOperandInvalidDotDotDotUncalledBuiltinInvalidAppendInvalidCapInvalidCloseInvalidCopyInvalidComplexInvalidDeleteInvalidImagInvalidLenSwappedMakeArgsInvalidMakeInvalidRealInvalidAssertImpossibleAssertInvalidConversionInvalidUntypedConversionBadOffsetofSyntaxInvalidOffsetofUnusedExprUnusedVarMissingReturnWrongResultCountOutOfScopeResultInvalidCondInvalidPostDeclInvalidChanRangeInvalidIterVarInvalidRangeExprMisplacedBreakMisplacedContinueMisplacedFallthroughDuplicateCaseDuplicateDefaultBadTypeKeywordInvalidTypeSwitchInvalidExprSwitchInvalidSelectCaseUndeclaredLabelDuplicateLabelMisplacedLabelUnusedLabelJumpOverDeclJumpIntoBlockInvalidMethodExprWrongArgCountInvalidCallUnusedResultsInvalidDeferInvalidGoBadDeclRepeatedDeclInvalidUnsafeAddInvalidUnsafeSliceUnsupportedFeatureNotAGenericTypeWrongTypeArgCountCannotInferTypeArgsInvalidTypeArgInvalidInstanceCycleInvalidUnionMisplacedConstraintIfaceInvalidMethodTypeParamsMisplacedTypeParamInvalidUnsafeSliceDataInvalidUnsafeString"
-)
-
-var (
- _ErrorCode_index_1 = [...]uint16{0, 4, 16, 33, 46, 59, 71, 85, 97, 113, 126, 142, 158, 174, 189, 205, 218, 234, 253, 261, 277, 295, 312, 330, 354, 362, 377, 393, 411, 428, 443, 450, 461, 484, 499, 511, 522, 537, 551, 566, 581, 594, 603, 617, 632, 643, 658, 667, 683, 703, 721, 740, 752, 771, 790, 806, 823, 842, 856, 867, 882, 895, 910, 926, 940, 956, 971, 988, 1006, 1021, 1031, 1041, 1058, 1080, 1094, 1108, 1128, 1146, 1166, 1184, 1207, 1223, 1238, 1251, 1261, 1273, 1284, 1298, 1311, 1322, 1332, 1347, 1358, 1369, 1382, 1398, 1415, 1439, 1456, 1471, 1481, 1490, 1503, 1519, 1535, 1546, 1561, 1577, 1591, 1607, 1621, 1638, 1658, 1671, 1687, 1701, 1718, 1735, 1752, 1767, 1781, 1795, 1806, 1818, 1831, 1848, 1861, 1872, 1885, 1897, 1906, 1913, 1925, 1941, 1959, 1977, 1992, 2009, 2028, 2042, 2062, 2074, 2098, 2121, 2139, 2161, 2180}
-)
-
-func (i ErrorCode) String() string {
- switch {
- case i == -1:
- return _ErrorCode_name_0
- case 1 <= i && i <= 146:
- i -= 1
- return _ErrorCode_name_1[_ErrorCode_index_1[i]:_ErrorCode_index_1[i+1]]
- default:
- return "ErrorCode(" + strconv.FormatInt(int64(i), 10) + ")"
- }
-}
+++ /dev/null
-// Copyright 2023 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 "go/types"
-
-// This file contains back doors that allow gopls to avoid method sorting when
-// using the objectpath package.
-//
-// This is performance-critical in certain repositories, but changing the
-// behavior of the objectpath package is still being discussed in
-// golang/go#61443. If we decide to remove the sorting in objectpath we can
-// simply delete these back doors. Otherwise, we should add a new API to
-// objectpath that allows controlling the sorting.
-
-// SkipEncoderMethodSorting marks enc (which must be an *objectpath.Encoder) as
-// not requiring sorted methods.
-var SkipEncoderMethodSorting func(enc interface{})
-
-// ObjectpathObject is like objectpath.Object, but allows suppressing method
-// sorting.
-var ObjectpathObject func(pkg *types.Package, p string, skipMethodSorting bool) (types.Object, error)
+++ /dev/null
-// Copyright 2020 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 provides access to internal go/types APIs that are not
-// yet exported.
-package typesinternal
-
-import (
- "go/token"
- "go/types"
- "reflect"
- "unsafe"
-)
-
-func SetUsesCgo(conf *types.Config) bool {
- v := reflect.ValueOf(conf).Elem()
-
- f := v.FieldByName("go115UsesCgo")
- if !f.IsValid() {
- f = v.FieldByName("UsesCgo")
- if !f.IsValid() {
- return false
- }
- }
-
- addr := unsafe.Pointer(f.UnsafeAddr())
- *(*bool)(addr) = true
-
- return true
-}
-
-// ReadGo116ErrorData extracts additional information from types.Error values
-// generated by Go version 1.16 and later: the error code, start position, and
-// end position. If all positions are valid, start <= err.Pos <= end.
-//
-// If the data could not be read, the final result parameter will be false.
-func ReadGo116ErrorData(err types.Error) (code ErrorCode, start, end token.Pos, ok bool) {
- var data [3]int
- // By coincidence all of these fields are ints, which simplifies things.
- v := reflect.ValueOf(err)
- for i, name := range []string{"go116code", "go116start", "go116end"} {
- f := v.FieldByName(name)
- if !f.IsValid() {
- return 0, 0, 0, false
- }
- data[i] = int(f.Int())
- }
- return ErrorCode(data[0]), token.Pos(data[1]), token.Pos(data[2]), true
-}
-
-var SetGoVersion = func(conf *types.Config, version string) bool { return false }
+++ /dev/null
-// Copyright 2021 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.
-
-//go:build go1.18
-// +build go1.18
-
-package typesinternal
-
-import (
- "go/types"
-)
-
-func init() {
- SetGoVersion = func(conf *types.Config, version string) bool {
- conf.GoVersion = version
- return true
- }
-}
# github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab
## explicit; go 1.13
github.com/ianlancetaylor/demangle
-# golang.org/x/arch v0.4.0
-## explicit; go 1.17
+# golang.org/x/arch v0.5.1-0.20231011141335-a6bdeed49307
+## explicit; go 1.18
golang.org/x/arch/arm/armasm
golang.org/x/arch/arm64/arm64asm
golang.org/x/arch/ppc64/ppc64asm
golang.org/x/arch/x86/x86asm
-# golang.org/x/mod v0.12.0
-## explicit; go 1.17
+# golang.org/x/mod v0.13.0
+## explicit; go 1.18
golang.org/x/mod/internal/lazyregexp
golang.org/x/mod/modfile
golang.org/x/mod/module
golang.org/x/mod/sumdb/note
golang.org/x/mod/sumdb/tlog
golang.org/x/mod/zip
-# golang.org/x/sync v0.3.0
-## explicit; go 1.17
+# golang.org/x/sync v0.4.1-0.20231011140417-10739b037d36
+## explicit; go 1.18
golang.org/x/sync/semaphore
-# golang.org/x/sys v0.13.0
-## explicit; go 1.17
+# golang.org/x/sys v0.13.1-0.20231011215430-1bfbee0e20e3
+## explicit; go 1.18
golang.org/x/sys/plan9
golang.org/x/sys/unix
golang.org/x/sys/windows
-# golang.org/x/term v0.13.0
-## explicit; go 1.17
+# golang.org/x/term v0.13.1-0.20231011140651-6a610bc55bff
+## explicit; go 1.18
golang.org/x/term
-# golang.org/x/tools v0.13.1-0.20230920233436-f9b8da7b22be
+# golang.org/x/tools v0.14.1-0.20231019165902-71f6a46884ab
## explicit; go 1.18
golang.org/x/tools/cmd/bisect
golang.org/x/tools/cover
golang.org/x/tools/internal/bisect
golang.org/x/tools/internal/facts
golang.org/x/tools/internal/typeparams
-golang.org/x/tools/internal/typesinternal
go 1.22
require (
- golang.org/x/crypto v0.14.0
- golang.org/x/net v0.17.0
+ golang.org/x/crypto v0.14.1-0.20231011220222-8779cbd1c995
+ golang.org/x/net v0.17.1-0.20231011215812-d23d9bc54922
)
require (
- golang.org/x/sys v0.13.0 // indirect
- golang.org/x/text v0.13.0 // indirect
+ golang.org/x/sys v0.13.1-0.20231011215430-1bfbee0e20e3 // indirect
+ golang.org/x/text v0.13.1-0.20231011215848-6c97a165dd66 // indirect
)
-golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc=
-golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4=
-golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM=
-golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE=
-golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
-golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
-golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
-golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
+golang.org/x/crypto v0.14.1-0.20231011220222-8779cbd1c995 h1:fwu25/DhiXr/++jtzz2gHfC/FL/FimAGVxczaK4pjR8=
+golang.org/x/crypto v0.14.1-0.20231011220222-8779cbd1c995/go.mod h1:aSyBXtGhRzSMdne9jbl3+PPMVS0IgOWF6Llc+HB5uUU=
+golang.org/x/net v0.17.1-0.20231011215812-d23d9bc54922 h1:5dPkjItO/mhqL4dWOB/ERHdeNKAe0YXhUnCOLpn/nwI=
+golang.org/x/net v0.17.1-0.20231011215812-d23d9bc54922/go.mod h1:ctp6Rq0w6YZwLQMXSCn4tot1uuoj9E9vKYJV26guPn4=
+golang.org/x/sys v0.13.1-0.20231011215430-1bfbee0e20e3 h1:G9se7UpoI67yWrFY0IIFGf6H3nwLLUZFDBCyOJwWeSc=
+golang.org/x/sys v0.13.1-0.20231011215430-1bfbee0e20e3/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
+golang.org/x/text v0.13.1-0.20231011215848-6c97a165dd66 h1:9Dyvhe9/DDm3upTpNNwowKgum0eUka4TBRU6uHiINKo=
+golang.org/x/text v0.13.1-0.20231011215848-6c97a165dd66/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
//go:build !nethttpomithttp2
-// +build !nethttpomithttp2
// Code generated by golang.org/x/tools/cmd/bundle. DO NOT EDIT.
// $ bundle -o=h2_bundle.go -prefix=http2 -tags=!nethttpomithttp2 golang.org/x/net/http2
// license that can be found in the LICENSE file.
//go:build gc && !purego
-// +build gc,!purego
package chacha20
// license that can be found in the LICENSE file.
//go:build gc && !purego
-// +build gc,!purego
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build (!arm64 && !s390x && !ppc64le) || !gc || purego
-// +build !arm64,!s390x,!ppc64le !gc purego
package chacha20
// license that can be found in the LICENSE file.
//go:build gc && !purego
-// +build gc,!purego
package chacha20
// due to the calling conventions and initialization of constants.
//go:build gc && !purego
-// +build gc,!purego
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build gc && !purego
-// +build gc,!purego
package chacha20
// license that can be found in the LICENSE file.
//go:build gc && !purego
-// +build gc,!purego
#include "go_asm.h"
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build gc && !purego
-// +build gc,!purego
package chacha20poly1305
// This file was originally from https://golang.org/cl/24717 by Vlad Krasnov of CloudFlare.
//go:build gc && !purego
-// +build gc,!purego
#include "textflag.h"
// General register allocation
// license that can be found in the LICENSE file.
//go:build !amd64 || !gc || purego
-// +build !amd64 !gc purego
package chacha20poly1305
// license that can be found in the LICENSE file.
//go:build !purego
-// +build !purego
// Package alias implements memory aliasing tests.
package alias
// license that can be found in the LICENSE file.
//go:build purego
-// +build purego
// Package alias implements memory aliasing tests.
package alias
// license that can be found in the LICENSE file.
//go:build !go1.13
-// +build !go1.13
package poly1305
// license that can be found in the LICENSE file.
//go:build go1.13
-// +build go1.13
package poly1305
// license that can be found in the LICENSE file.
//go:build (!amd64 && !ppc64le && !s390x) || !gc || purego
-// +build !amd64,!ppc64le,!s390x !gc purego
package poly1305
// license that can be found in the LICENSE file.
//go:build gc && !purego
-// +build gc,!purego
package poly1305
// license that can be found in the LICENSE file.
//go:build gc && !purego
-// +build gc,!purego
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build gc && !purego
-// +build gc,!purego
package poly1305
// license that can be found in the LICENSE file.
//go:build gc && !purego
-// +build gc,!purego
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build gc && !purego
-// +build gc,!purego
package poly1305
// license that can be found in the LICENSE file.
//go:build gc && !purego
-// +build gc,!purego
#include "textflag.h"
}
// SkipAnswer skips a single Answer Resource.
+//
+// It does not perform a complete validation of the resource header, which means
+// it may return a nil error when the [AnswerHeader] would actually return an error.
func (p *Parser) SkipAnswer() error {
return p.skipResource(sectionAnswers)
}
}
// SkipAuthority skips a single Authority Resource.
+//
+// It does not perform a complete validation of the resource header, which means
+// it may return a nil error when the [AuthorityHeader] would actually return an error.
func (p *Parser) SkipAuthority() error {
return p.skipResource(sectionAuthorities)
}
}
// SkipAdditional skips a single Additional Resource.
+//
+// It does not perform a complete validation of the resource header, which means
+// it may return a nil error when the [AdditionalHeader] would actually return an error.
func (p *Parser) SkipAdditional() error {
return p.skipResource(sectionAdditionals)
}
// license that can be found in the LICENSE file.
//go:build go1.18
-// +build go1.18
package idna
// license that can be found in the LICENSE file.
//go:build go1.10
-// +build go1.10
// Package idna implements IDNA2008 using the compatibility processing
// defined by UTS (Unicode Technical Standard) #46, which defines a standard to
// license that can be found in the LICENSE file.
//go:build !go1.10
-// +build !go1.10
// Package idna implements IDNA2008 using the compatibility processing
// defined by UTS (Unicode Technical Standard) #46, which defines a standard to
// license that can be found in the LICENSE file.
//go:build !go1.18
-// +build !go1.18
package idna
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build go1.10 && !go1.13
-// +build go1.10,!go1.13
package idna
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build go1.13 && !go1.14
-// +build go1.13,!go1.14
package idna
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build go1.14 && !go1.16
-// +build go1.14,!go1.16
package idna
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build go1.16 && !go1.21
-// +build go1.16,!go1.21
package idna
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build go1.21
-// +build go1.21
package idna
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build !go1.10
-// +build !go1.10
package idna
// license that can be found in the LICENSE file.
//go:build !go1.16
-// +build !go1.16
package idna
// license that can be found in the LICENSE file.
//go:build go1.16
-// +build go1.16
package idna
// license that can be found in the LICENSE file.
//go:build solaris
-// +build solaris
package lif
// license that can be found in the LICENSE file.
//go:build solaris
-// +build solaris
package lif
// license that can be found in the LICENSE file.
//go:build solaris
-// +build solaris
// Package lif provides basic functions for the manipulation of
// logical network interfaces and interface addresses on Solaris.
// license that can be found in the LICENSE file.
//go:build solaris
-// +build solaris
package lif
// license that can be found in the LICENSE file.
//go:build solaris
-// +build solaris
package lif
// license that can be found in the LICENSE file.
//go:build solaris
-// +build solaris
package lif
// license that can be found in the LICENSE file.
//go:build !aix && !darwin && !dragonfly && !freebsd && !linux && !netbsd && !openbsd && !solaris && !windows && !zos
-// +build !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd,!solaris,!windows,!zos
package nettest
// license that can be found in the LICENSE file.
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || zos
-// +build aix darwin dragonfly freebsd linux netbsd openbsd solaris zos
package nettest
// license that can be found in the LICENSE file.
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
-// +build darwin dragonfly freebsd netbsd openbsd
package route
// license that can be found in the LICENSE file.
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
-// +build darwin dragonfly freebsd netbsd openbsd
package route
// license that can be found in the LICENSE file.
//go:build darwin && go1.12
-// +build darwin,go1.12
// This exists solely so we can linkname in symbols from syscall.
// license that can be found in the LICENSE file.
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
-// +build darwin dragonfly freebsd netbsd openbsd
package route
// license that can be found in the LICENSE file.
//go:build dragonfly || freebsd || netbsd
-// +build dragonfly freebsd netbsd
package route
// license that can be found in the LICENSE file.
//go:build darwin || dragonfly || netbsd
-// +build darwin dragonfly netbsd
package route
// license that can be found in the LICENSE file.
//go:build darwin || dragonfly || freebsd
-// +build darwin dragonfly freebsd
package route
// license that can be found in the LICENSE file.
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
-// +build darwin dragonfly freebsd netbsd openbsd
package route
// license that can be found in the LICENSE file.
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
-// +build darwin dragonfly freebsd netbsd openbsd
// Package route provides basic functions for the manipulation of
// packet routing facilities on BSD variants.
// license that can be found in the LICENSE file.
//go:build darwin || dragonfly || freebsd || netbsd
-// +build darwin dragonfly freebsd netbsd
package route
// license that can be found in the LICENSE file.
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
-// +build darwin dragonfly freebsd netbsd openbsd
package route
// license that can be found in the LICENSE file.
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
-// +build darwin dragonfly freebsd netbsd openbsd
package route
// license that can be found in the LICENSE file.
//go:build gc
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build aix
-// +build aix
package cpu
// license that can be found in the LICENSE file.
//go:build gc
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build gc
-// +build gc
package cpu
// license that can be found in the LICENSE file.
//go:build gc
-// +build gc
package cpu
// license that can be found in the LICENSE file.
//go:build (386 || amd64 || amd64p32) && gc
-// +build 386 amd64 amd64p32
-// +build gc
package cpu
// license that can be found in the LICENSE file.
//go:build gccgo
-// +build gccgo
package cpu
// license that can be found in the LICENSE file.
//go:build gccgo
-// +build gccgo
package cpu
// license that can be found in the LICENSE file.
//go:build (386 || amd64 || amd64p32) && gccgo
-// +build 386 amd64 amd64p32
-// +build gccgo
#include <cpuid.h>
#include <stdint.h>
// license that can be found in the LICENSE file.
//go:build (386 || amd64 || amd64p32) && gccgo
-// +build 386 amd64 amd64p32
-// +build gccgo
package cpu
// license that can be found in the LICENSE file.
//go:build !386 && !amd64 && !amd64p32 && !arm64
-// +build !386,!amd64,!amd64p32,!arm64
package cpu
// license that can be found in the LICENSE file.
//go:build linux && (mips64 || mips64le)
-// +build linux
-// +build mips64 mips64le
package cpu
// license that can be found in the LICENSE file.
//go:build linux && !arm && !arm64 && !mips64 && !mips64le && !ppc64 && !ppc64le && !s390x
-// +build linux,!arm,!arm64,!mips64,!mips64le,!ppc64,!ppc64le,!s390x
package cpu
// license that can be found in the LICENSE file.
//go:build linux && (ppc64 || ppc64le)
-// +build linux
-// +build ppc64 ppc64le
package cpu
// license that can be found in the LICENSE file.
//go:build loong64
-// +build loong64
package cpu
// license that can be found in the LICENSE file.
//go:build mips64 || mips64le
-// +build mips64 mips64le
package cpu
// license that can be found in the LICENSE file.
//go:build mips || mipsle
-// +build mips mipsle
package cpu
// license that can be found in the LICENSE file.
//go:build !linux && arm
-// +build !linux,arm
package cpu
// license that can be found in the LICENSE file.
//go:build !linux && !netbsd && !openbsd && arm64
-// +build !linux,!netbsd,!openbsd,arm64
package cpu
// license that can be found in the LICENSE file.
//go:build !linux && (mips64 || mips64le)
-// +build !linux
-// +build mips64 mips64le
package cpu
// license that can be found in the LICENSE file.
//go:build !aix && !linux && (ppc64 || ppc64le)
-// +build !aix
-// +build !linux
-// +build ppc64 ppc64le
package cpu
// license that can be found in the LICENSE file.
//go:build !linux && riscv64
-// +build !linux,riscv64
package cpu
// license that can be found in the LICENSE file.
//go:build ppc64 || ppc64le
-// +build ppc64 ppc64le
package cpu
// license that can be found in the LICENSE file.
//go:build riscv64
-// +build riscv64
package cpu
// license that can be found in the LICENSE file.
//go:build gc
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build wasm
-// +build wasm
package cpu
// license that can be found in the LICENSE file.
//go:build 386 || amd64 || amd64p32
-// +build 386 amd64 amd64p32
package cpu
// license that can be found in the LICENSE file.
//go:build (386 || amd64 || amd64p32) && gc
-// +build 386 amd64 amd64p32
-// +build gc
#include "textflag.h"
// license that can be found in the LICENSE file.
//go:build armbe || arm64be || m68k || mips || mips64 || mips64p32 || ppc || ppc64 || s390 || s390x || shbe || sparc || sparc64
-// +build armbe arm64be m68k mips mips64 mips64p32 ppc ppc64 s390 s390x shbe sparc sparc64
package cpu
// license that can be found in the LICENSE file.
//go:build 386 || amd64 || amd64p32 || alpha || arm || arm64 || loong64 || mipsle || mips64le || mips64p32le || nios2 || ppc64le || riscv || riscv64 || sh || wasm
-// +build 386 amd64 amd64p32 alpha arm arm64 loong64 mipsle mips64le mips64p32le nios2 ppc64le riscv riscv64 sh wasm
package cpu
// license that can be found in the LICENSE file.
//go:build linux && arm64
-// +build linux,arm64
package cpu
// license that can be found in the LICENSE file.
//go:build go1.21
-// +build go1.21
package cpu
// gccgo's libgo and thus must not used a CGo method.
//go:build aix && gccgo
-// +build aix,gccgo
package cpu
// (See golang.org/issue/32102)
//go:build aix && ppc64 && gc
-// +build aix,ppc64,gc
package cpu
// license that can be found in the LICENSE file.
//go:build go1.10
-// +build go1.10
package bidirule
// license that can be found in the LICENSE file.
//go:build !go1.10
-// +build !go1.10
package bidirule
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build go1.10 && !go1.13
-// +build go1.10,!go1.13
package bidi
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build go1.13 && !go1.14
-// +build go1.13,!go1.14
package bidi
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build go1.14 && !go1.16
-// +build go1.14,!go1.16
package bidi
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build go1.16 && !go1.21
-// +build go1.16,!go1.21
package bidi
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build go1.21
-// +build go1.21
package bidi
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build !go1.10
-// +build !go1.10
package bidi
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build go1.10 && !go1.13
-// +build go1.10,!go1.13
package norm
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build go1.13 && !go1.14
-// +build go1.13,!go1.14
package norm
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build go1.14 && !go1.16
-// +build go1.14,!go1.16
package norm
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build go1.16 && !go1.21
-// +build go1.16,!go1.21
package norm
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build go1.21
-// +build go1.21
package norm
// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT.
//go:build !go1.10
-// +build !go1.10
package norm
-# golang.org/x/crypto v0.14.0
-## explicit; go 1.17
+# golang.org/x/crypto v0.14.1-0.20231011220222-8779cbd1c995
+## explicit; go 1.18
golang.org/x/crypto/chacha20
golang.org/x/crypto/chacha20poly1305
golang.org/x/crypto/cryptobyte
golang.org/x/crypto/hkdf
golang.org/x/crypto/internal/alias
golang.org/x/crypto/internal/poly1305
-# golang.org/x/net v0.17.0
-## explicit; go 1.17
+# golang.org/x/net v0.17.1-0.20231011215812-d23d9bc54922
+## explicit; go 1.18
golang.org/x/net/dns/dnsmessage
golang.org/x/net/http/httpguts
golang.org/x/net/http/httpproxy
golang.org/x/net/lif
golang.org/x/net/nettest
golang.org/x/net/route
-# golang.org/x/sys v0.13.0
-## explicit; go 1.17
+# golang.org/x/sys v0.13.1-0.20231011215430-1bfbee0e20e3
+## explicit; go 1.18
golang.org/x/sys/cpu
-# golang.org/x/text v0.13.0
-## explicit; go 1.17
+# golang.org/x/text v0.13.1-0.20231011215848-6c97a165dd66
+## explicit; go 1.18
golang.org/x/text/secure/bidirule
golang.org/x/text/transform
golang.org/x/text/unicode/bidi