import "github.com/dotcloud/docker/utils" statusMsg := "Container started successfully" msgType := utils.Status formattedMsg := utils.StreamFormatter.FormatStatus(statusMsg, msgType) // Output: "[status] Container started successfully"
statusMsg := "Error: Container failed to start" msgType := utils.Error formattedMsg := utils.StreamFormatter.FormatStatus(statusMsg, msgType) // Output: "[error] Error: Container failed to start"In both examples, the function takes in the status message and message type, formats the message with the appropriate prefix, and returns the formatted string. This function is commonly used in docker CLI commands to print out status messages to the command line interface.