Skip to content

Commit 4d60e99

Browse files
committed
embed
1 parent 89b2690 commit 4d60e99

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

main.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22
package main
33

44
import (
5+
_ "embed"
56
"fmt"
67
"log"
7-
"os"
88
)
99

10+
//go:embed README.adoc
11+
var data string
12+
1013
func main() {
11-
data, err := os.ReadFile("README.adoc")
12-
if err != nil {
13-
log.Fatal(err)
14+
if data == "" {
15+
log.Fatal("README.adoc content is empty")
1416
}
15-
fmt.Print(string(data))
17+
fmt.Print(data)
1618
}

0 commit comments

Comments
 (0)