Fixing a compliation error and possibly versioning.
Some checks failed
G'Agent Scan, Build, and Test / scan (push) Successful in 1m44s
G'Agent Scan, Build, and Test / build_simple (push) Failing after 1m16s
G'Agent Scan, Build, and Test / test_simple (push) Has been skipped
G'Agent Scan, Build, and Test / build_image (push) Has been skipped

This commit is contained in:
James Wells 2024-12-26 14:30:23 -08:00
parent df07f6be28
commit 91c591e22f
Signed by: jwells
GPG key ID: 73196D10B8E65666
2 changed files with 6 additions and 6 deletions

View file

@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- run: go build -o test_artifact cmd/hello/main.go - run: go build -o test_artifact cmd/gagent/main.go
- run: ./test_artifact --version - run: ./test_artifact --version
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
@ -50,7 +50,7 @@ jobs:
container: container:
image: dragonheim/golang:latest image: dragonheim/golang:latest
steps: steps:
- run: apk add --no-cache nodejs npm - run: apk add --no-cache zeromq-dev nodejs npm
- uses: actions/download-artifact@v3 - uses: actions/download-artifact@v3
with: with:
name: test_artifact name: test_artifact

View file

@ -1,11 +1,11 @@
package main package main
import ( import (
debug "runtime/debug"
flag "flag" flag "flag"
log "log" log "log"
http "net/http" http "net/http"
os "os" os "os"
debug "runtime/debug"
strconv "strconv" strconv "strconv"
sync "sync" sync "sync"
@ -31,7 +31,6 @@ import (
promhttp "github.com/prometheus/client_golang/prometheus/promhttp" promhttp "github.com/prometheus/client_golang/prometheus/promhttp"
uuid "github.com/jakehl/goid" uuid "github.com/jakehl/goid"
//versioninfo "github.com/carlmjohnson/versioninfo" //versioninfo "github.com/carlmjohnson/versioninfo"
) )
@ -152,7 +151,8 @@ func init() {
/* /*
* Initialize the configuration * Initialize the configuration
*/ */
config.Version, err = debug.ReadBuildInfo() buildInfo, _ := debug.ReadBuildInfo()
config.Version = buildInfo.Main.Version
// config.Version = versioninfo.Version // config.Version = versioninfo.Version
config.File = cfg.ConfigFile config.File = cfg.ConfigFile
@ -228,7 +228,7 @@ func init() {
usage += "Options:\n" usage += "Options:\n"
usage += " -h, --help -- Show this help screen and exit\n" usage += " -h, --help -- Show this help screen and exit\n"
usage += " -v, -version -- Show version and exit\n" usage += " -v, --version -- Show version and exit\n"
usage += " --config=<config> -- [default: /etc/gagent/gagent.hcl]\n" usage += " --config=<config> -- [default: /etc/gagent/gagent.hcl]\n"
usage += " --agent=<file> -- filename of the agent to be uploaded to the G'Agent network. Required in push mode\n" usage += " --agent=<file> -- filename of the agent to be uploaded to the G'Agent network. Required in push mode\n"
usage += "\n" usage += "\n"