diff --git a/versioned_docs/version-1.2/how_to_guides/go_script.mdx b/versioned_docs/version-1.2/how_to_guides/go_script.mdx index 22808453..d620b0bb 100644 --- a/versioned_docs/version-1.2/how_to_guides/go_script.mdx +++ b/versioned_docs/version-1.2/how_to_guides/go_script.mdx @@ -24,8 +24,11 @@ func main() { args := []string{"repo", "ls", "mcr.microsoft.com"} cmd := root.New() cmd.SetArgs(args) + builder := &strings.Builder{} + cmd.SetOut(builder) fmt.Printf("Executing 'oras %s':", strings.Join(args, " ")) err := cmd.Execute() + fmt.Println(builder.String()) if err != nil { fmt.Errorf("Failed to execute : %w", err) os.Exit(-1)