From e58181a930064385c881b7ee1cac4914dd435121 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Tue, 30 Sep 2025 00:21:26 +0900 Subject: internal/app/paths: defer extra formatting This reduces payload size for params to shim. Signed-off-by: Ophestra --- cmd/hakurei/command.go | 2 +- cmd/hakurei/parse.go | 2 +- cmd/hakurei/print.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/hakurei/command.go b/cmd/hakurei/command.go index b9da60be..ddd07bac 100644 --- a/cmd/hakurei/command.go +++ b/cmd/hakurei/command.go @@ -231,7 +231,7 @@ func buildCommand(ctx context.Context, msg container.Msg, early *earlyHardeningE var flagShort bool c.NewCommand("ps", "List active instances", func(args []string) error { var sc hst.Paths - app.CopyPaths(&sc, new(app.Hsu).MustID()) + app.CopyPaths().Copy(&sc, new(app.Hsu).MustID()) printPs(os.Stdout, time.Now().UTC(), state.NewMulti(msg, sc.RunDirPath.String()), flagShort, flagJSON) return errSuccess }).Flag(&flagShort, "short", command.BoolFlag(false), "Print instance id") diff --git a/cmd/hakurei/parse.go b/cmd/hakurei/parse.go index eee7d323..14b9c167 100644 --- a/cmd/hakurei/parse.go +++ b/cmd/hakurei/parse.go @@ -89,7 +89,7 @@ func tryShort(msg container.Msg, name string) (config *hst.Config, entry *state. msg.Verbose("argument looks like prefix") var sc hst.Paths - app.CopyPaths(&sc, new(app.Hsu).MustID()) + app.CopyPaths().Copy(&sc, new(app.Hsu).MustID()) s := state.NewMulti(msg, sc.RunDirPath.String()) if entries, err := state.Join(s); err != nil { log.Printf("cannot join store: %v", err) diff --git a/cmd/hakurei/print.go b/cmd/hakurei/print.go index 938517b8..eefe1345 100644 --- a/cmd/hakurei/print.go +++ b/cmd/hakurei/print.go @@ -22,7 +22,7 @@ func printShowSystem(output io.Writer, short, flagJSON bool) { defer t.MustFlush() info := &hst.Info{User: new(app.Hsu).MustID()} - app.CopyPaths(&info.Paths, info.User) + app.CopyPaths().Copy(&info.Paths, info.User) if flagJSON { printJSON(output, short, info) -- cgit v1.3.1