| 1 | // Copyright 2022 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 | //go:build go1.20 |
| 6 | // +build go1.20 |
| 7 | |
| 8 | package a |
| 9 | |
| 10 | var ( |
| 11 | // Okay directive wise but the compiler will complain that |
| 12 | // imports must appear before other declarations. |
| 13 | //go:embed embedText // ok |
| 14 | foo string |
| 15 | ) |
| 16 | |
| 17 | import ( |
| 18 | "fmt" |
| 19 | |
| 20 | _ "embed" |
| 21 | ) |
| 22 | |
| 23 | // This is main function |
| 24 | func main() { |
| 25 | fmt.Println(s) |
| 26 | } |