src/cmd/link/testdata/linkname/sched.go
raw| 1 | // Copyright 2025 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 | package main |
| 6 | |
| 7 | import _ "unsafe" |
| 8 | |
| 9 | type schedt struct{} |
| 10 | |
| 11 | //go:linkname sched runtime.sched |
| 12 | var sched schedt |
| 13 | |
| 14 | func main() { |
| 15 | select { |
| 16 | default: |
| 17 | println("hello") |
| 18 | } |
| 19 | } |