Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ jobs:
go-version-file: apps/agent/go.mod
cache-dependency-path: apps/agent/go.sum

- name: Check formatting
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "not gofmt-formatted:"
echo "$unformatted"
exit 1
fi

- name: Verify go.mod is tidy
run: |
go mod tidy
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ jobs:
go-version-file: apps/cli/go.mod
cache-dependency-path: apps/cli/go.sum

- name: Check formatting
run: |
unformatted=$(gofmt -l .)
if [ -n "$unformatted" ]; then
echo "not gofmt-formatted:"
echo "$unformatted"
exit 1
fi

- name: Vet
run: go vet ./...

Expand Down
74 changes: 37 additions & 37 deletions apps/agent/cmd/agent/main.go
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
package main
import (
"context"
"flag"
"fmt"
"os"
"docksight-agent/internal/app"
"docksight-agent/internal/service"
"docksight-agent/internal/version"
)
func main() {
configPath := flag.String("config", "config.yaml", "path to agent config.yaml")
showVersion := flag.Bool("version", false, "print version and exit")
flag.Parse()
if *showVersion {
fmt.Println(version.String())
return
}
application := app.New(*configPath)
// service.Run decides how the agent is supervised: directly in a console,
// or dispatched to the Windows Service Control Manager. The same binary
// serves both, detected at runtime rather than selected by a flag.
err := service.Run(func(ctx context.Context) error {
return application.Run(ctx)
})
if err != nil {
fmt.Fprintf(os.Stderr, "docksight-agent: %v\n", err)
os.Exit(1)
}
}
package main

import (
"context"
"flag"
"fmt"
"os"

"docksight-agent/internal/app"
"docksight-agent/internal/service"
"docksight-agent/internal/version"
)

func main() {
configPath := flag.String("config", "config.yaml", "path to agent config.yaml")
showVersion := flag.Bool("version", false, "print version and exit")
flag.Parse()

if *showVersion {
fmt.Println(version.String())
return
}

application := app.New(*configPath)

// service.Run decides how the agent is supervised: directly in a console,
// or dispatched to the Windows Service Control Manager. The same binary
// serves both, detected at runtime rather than selected by a flag.
err := service.Run(func(ctx context.Context) error {
return application.Run(ctx)
})

if err != nil {
fmt.Fprintf(os.Stderr, "docksight-agent: %v\n", err)
os.Exit(1)
}
}
Loading
Loading