Skip to content

Commit

Permalink
use embed go file
Browse files Browse the repository at this point in the history
  • Loading branch information
xiantang committed Oct 23, 2023
1 parent 4ba9c9e commit 02aa39f
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
_ "embed"
"flag"
"fmt"

Check failure on line 6 in main.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

undefined: Println

Check failure on line 6 in main.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

undefined: Println

Check failure on line 6 in main.go

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest)

undefined: Println

Check failure on line 6 in main.go

View workflow job for this annotation

GitHub Actions / build (macos-latest)

undefined: Println

Check failure on line 6 in main.go

View workflow job for this annotation

GitHub Actions / build (macos-latest)

undefined: Println

Check failure on line 6 in main.go

View workflow job for this annotation

GitHub Actions / build (macos-latest)

undefined: Println
"log"
Expand All @@ -20,6 +21,9 @@ var (
showVersion bool
help bool
cmdArgs map[string]runner.TomlInfo

//go:embed air_example.toml
airExampleToml string
)

func usage() {
Expand Down Expand Up @@ -74,13 +78,8 @@ func GetVersionInfo() versionInfo {
}

func helpMessage() {
data, err := os.ReadFile("air_example.toml")
if err != nil {
log.Fatal(err)
}

var cfg runner.Config
err = toml.Unmarshal(data, &cfg)
err := toml.Unmarshal([]byte(airExampleToml), &cfg)
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 02aa39f

Please sign in to comment.