Skip to content

Commit

Permalink
Extend known for Go 1.23 compiler directives
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear committed Nov 20, 2024
1 parent 21d3bfd commit 07893be
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions checkcompilerdirectives/checkcompilerdirectives.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,23 +72,23 @@ func isKnown(directive string) bool {
return false
}

// Found by running the following command on the source of go.
// git grep -o -E -h '//go:[a-z_-]+' -- ':!**/*_test.go' ':!test/' ':!**/testdata/**' | sort -u
// See https://pkg.go.dev/cmd/[email protected]#hdr-Compiler_Directives
var known = []string{
// Found by running the following command on the source of go.
// git grep -o -E -h '//go:[a-z_]+' -- ':!**/*_test.go' ':!test/' ':!**/testdata/**' | sort -u
"binary",
"binary-only-package", // https://pkg.go.dev/go/[email protected]#hdr-Binary_Only_Packages
"build",
"buildsomethingelse",
"cgo_dynamic_linker",
"cgo_export_dynamic",
"cgo_export_static",
"cgo_import_dynamic",
"cgo_import_static",
"cgo_ldflag",
"cgo_unsafe_args",
"debug", // https://go.dev/doc/godebug
"embed",
"generate",
"linkname",
"name",
"nocheckptr",
"noescape",
"noinline",
Expand All @@ -101,5 +101,6 @@ var known = []string{
"systemstack",
"uintptrescapes",
"uintptrkeepalive",
"wasmimport",
"yeswritebarrierrec",
}

0 comments on commit 07893be

Please sign in to comment.