test/fixedbugs/issue66575.go
raw| 1 | // run |
| 2 | |
| 3 | // Copyright 2024 The Go Authors. All rights reserved. |
| 4 | // Use of this source code is governed by a BSD-style |
| 5 | // license that can be found in the LICENSE file. |
| 6 | |
| 7 | package main |
| 8 | |
| 9 | var ( |
| 10 | v0 = initv0() |
| 11 | v1 = initv1() |
| 12 | ) |
| 13 | |
| 14 | const c = "c" |
| 15 | |
| 16 | func initv0() string { |
| 17 | println("initv0") |
| 18 | if c != "" { // have a dependency on c |
| 19 | return "" |
| 20 | } |
| 21 | return "" |
| 22 | } |
| 23 | |
| 24 | func initv1() string { |
| 25 | println("initv1") |
| 26 | return "" |
| 27 | } |
| 28 | |
| 29 | func main() { |
| 30 | // do nothing |
| 31 | } |