Source file src/cmd/link/testdata/linkname/textvar/main.go
1 // Copyright 2024 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // Using a linknamed variable to reference an assembly 6 // function in the same package is ok. 7 8 package main 9 10 import _ "unsafe" 11 12 func main() { 13 println(&asmfunc) 14 } 15 16 //go:linkname asmfunc 17 var asmfunc uintptr 18