@@ -17,21 +17,21 @@ type TrapEntry struct {
1717 Context spire.EntryContext
1818}
1919
20- func Render (invocation []string , result InvocationResult , title string , tags []string , showEnv bool ) TrapEntry {
20+ func Render (invocation []string , result * InvocationResult , title string , tags []string , showEnv bool ) TrapEntry {
2121 renderedTitle := RenderTitle (invocation , result , title , tags , showEnv )
2222 renderedTags := RenderTags (invocation , result , title , tags , showEnv )
2323 renderedContent := RenderContent (invocation , result , title , tags , showEnv )
2424 return TrapEntry {Title : renderedTitle , Content : renderedContent , Tags : renderedTags , Context : spire.EntryContext {ContextType : "trap" }}
2525}
2626
27- func RenderTitle (invocation []string , result InvocationResult , title string , tags []string , showEnv bool ) string {
27+ func RenderTitle (invocation []string , result * InvocationResult , title string , tags []string , showEnv bool ) string {
2828 if title != "" {
2929 return title
3030 }
3131 return fmt .Sprintf ("Command: %s (exited with code %d)" , invocation [0 ], result .ExitCode )
3232}
3333
34- func RenderTags (invocation []string , result InvocationResult , title string , tags []string , showEnv bool ) []string {
34+ func RenderTags (invocation []string , result * InvocationResult , title string , tags []string , showEnv bool ) []string {
3535 trapTags := []string {
3636 "trap" ,
3737 "cli" ,
@@ -43,7 +43,7 @@ func RenderTags(invocation []string, result InvocationResult, title string, tags
4343 return finalTags
4444}
4545
46- func RenderContent (invocation []string , result InvocationResult , title string , tags []string , showEnv bool ) string {
46+ func RenderContent (invocation []string , result * InvocationResult , title string , tags []string , showEnv bool ) string {
4747 quotedInvocation := make ([]string , len (invocation ))
4848 for i , component := range invocation {
4949 quotedInvocation [i ] = strconv .Quote (component )
@@ -59,8 +59,8 @@ func RenderContent(invocation []string, result InvocationResult, title string, t
5959 var content string = strings .Join ([]string {
6060 fmt .Sprintf ("## invocation\n ```\n %s\n ```\n " , strings .Join (quotedInvocation , " " )),
6161 fmt .Sprintf ("## exit code\n `%d`\n " , result .ExitCode ),
62- fmt .Sprintf ("## stdout\n ```\n %s\n ```\n " , result .OutBuffer . String () ),
63- fmt .Sprintf ("## stderr\n ```\n %s\n ```\n " , result .ErrBuffer . String () ),
62+ fmt .Sprintf ("## stdout\n ```\n %s\n ```\n " , result .Stdout ),
63+ fmt .Sprintf ("## stderr\n ```\n %s\n ```\n " , result .Stderr ),
6464 }, "\n " )
6565
6666 if showEnv {
0 commit comments