打印 service 列表
(dockerComposeContainers []DockerComposeContainer)
| 148 | |
| 149 | // 打印 service 列表 |
| 150 | func PrintDockerComposeContainers(dockerComposeContainers []DockerComposeContainer) { |
| 151 | if len(dockerComposeContainers) <= 0 { |
| 152 | return |
| 153 | } |
| 154 | w := tabwriter.NewWriter(os.Stdout, 1, 1, 1, ' ', 0) |
| 155 | fmt.Fprintln(w, i18nInstance.Common.Info_table_header_containers) |
| 156 | for _, service := range dockerComposeContainers { |
| 157 | line := fmt.Sprintf("%v\t%v\t%v\t%v\t", service.ServiceName, service.State, service.Image, strings.Join(service.Ports, "; ")) |
| 158 | fmt.Fprintln(w, line) |
| 159 | } |
| 160 | w.Flush() |
| 161 | } |
no test coverage detected