mirror of https://github.com/k3s-io/k3s
Export PrintOptions struct
parent
4f559b3af7
commit
5a59dac0dd
|
@ -300,13 +300,13 @@ type handlerEntry struct {
|
|||
printFunc reflect.Value
|
||||
}
|
||||
|
||||
type printOptions struct {
|
||||
noHeaders bool
|
||||
withNamespace bool
|
||||
wide bool
|
||||
showAll bool
|
||||
absoluteTimestamps bool
|
||||
columnLabels []string
|
||||
type PrintOptions struct {
|
||||
NoHeaders bool
|
||||
WithNamespace bool
|
||||
Wide bool
|
||||
ShowAll bool
|
||||
AbsoluteTimestamps bool
|
||||
ColumnLabels []string
|
||||
}
|
||||
|
||||
// HumanReadablePrinter is an implementation of ResourcePrinter which attempts to provide
|
||||
|
@ -315,7 +315,7 @@ type printOptions struct {
|
|||
// received from watches.
|
||||
type HumanReadablePrinter struct {
|
||||
handlerMap map[reflect.Type]*handlerEntry
|
||||
options printOptions
|
||||
options PrintOptions
|
||||
lastType reflect.Type
|
||||
}
|
||||
|
||||
|
@ -323,13 +323,13 @@ type HumanReadablePrinter struct {
|
|||
func NewHumanReadablePrinter(noHeaders, withNamespace bool, wide bool, showAll bool, absoluteTimestamps bool, columnLabels []string) *HumanReadablePrinter {
|
||||
printer := &HumanReadablePrinter{
|
||||
handlerMap: make(map[reflect.Type]*handlerEntry),
|
||||
options: printOptions{
|
||||
noHeaders: noHeaders,
|
||||
withNamespace: withNamespace,
|
||||
wide: wide,
|
||||
showAll: showAll,
|
||||
absoluteTimestamps: absoluteTimestamps,
|
||||
columnLabels: columnLabels,
|
||||
options: PrintOptions{
|
||||
NoHeaders: noHeaders,
|
||||
WithNamespace: withNamespace,
|
||||
Wide: wide,
|
||||
ShowAll: showAll,
|
||||
AbsoluteTimestamps: absoluteTimestamps,
|
||||
ColumnLabels: columnLabels,
|
||||
},
|
||||
}
|
||||
printer.addDefaultHandlers()
|
||||
|
@ -367,10 +367,10 @@ func (h *HumanReadablePrinter) validatePrintHandlerFunc(printFunc reflect.Value)
|
|||
"Must accept 3 parameters and return 1 value.")
|
||||
}
|
||||
if funcType.In(1) != reflect.TypeOf((*io.Writer)(nil)).Elem() ||
|
||||
funcType.In(2) != reflect.TypeOf((*printOptions)(nil)).Elem() ||
|
||||
funcType.In(2) != reflect.TypeOf((*PrintOptions)(nil)).Elem() ||
|
||||
funcType.Out(0) != reflect.TypeOf((*error)(nil)).Elem() {
|
||||
return fmt.Errorf("invalid print handler. The expected signature is: "+
|
||||
"func handler(obj %v, w io.Writer, options printOptions) error", funcType.In(0))
|
||||
"func handler(obj %v, w io.Writer, options PrintOptions) error", funcType.In(0))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -539,11 +539,11 @@ func translateTimestamp(timestamp unversioned.Time) string {
|
|||
return shortHumanDuration(time.Now().Sub(timestamp.Time))
|
||||
}
|
||||
|
||||
func printPod(pod *api.Pod, w io.Writer, options printOptions) error {
|
||||
func printPod(pod *api.Pod, w io.Writer, options PrintOptions) error {
|
||||
return printPodBase(pod, w, options)
|
||||
}
|
||||
|
||||
func printPodBase(pod *api.Pod, w io.Writer, options printOptions) error {
|
||||
func printPodBase(pod *api.Pod, w io.Writer, options PrintOptions) error {
|
||||
name := pod.Name
|
||||
namespace := pod.Namespace
|
||||
|
||||
|
@ -553,7 +553,7 @@ func printPodBase(pod *api.Pod, w io.Writer, options printOptions) error {
|
|||
|
||||
reason := string(pod.Status.Phase)
|
||||
// if not printing all pods, skip terminated pods (default)
|
||||
if !options.showAll && (reason == string(api.PodSucceeded) || reason == string(api.PodFailed)) {
|
||||
if !options.ShowAll && (reason == string(api.PodSucceeded) || reason == string(api.PodFailed)) {
|
||||
return nil
|
||||
}
|
||||
if pod.Status.Reason != "" {
|
||||
|
@ -582,7 +582,7 @@ func printPodBase(pod *api.Pod, w io.Writer, options printOptions) error {
|
|||
reason = "Terminating"
|
||||
}
|
||||
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -598,7 +598,7 @@ func printPodBase(pod *api.Pod, w io.Writer, options printOptions) error {
|
|||
return err
|
||||
}
|
||||
|
||||
if options.wide {
|
||||
if options.Wide {
|
||||
nodeName := pod.Spec.NodeName
|
||||
if _, err := fmt.Fprintf(w, "\t%s",
|
||||
nodeName,
|
||||
|
@ -607,11 +607,11 @@ func printPodBase(pod *api.Pod, w io.Writer, options printOptions) error {
|
|||
}
|
||||
}
|
||||
|
||||
_, err := fmt.Fprint(w, appendLabels(pod.Labels, options.columnLabels))
|
||||
_, err := fmt.Fprint(w, appendLabels(pod.Labels, options.ColumnLabels))
|
||||
return err
|
||||
}
|
||||
|
||||
func printPodList(podList *api.PodList, w io.Writer, options printOptions) error {
|
||||
func printPodList(podList *api.PodList, w io.Writer, options PrintOptions) error {
|
||||
for _, pod := range podList.Items {
|
||||
if err := printPodBase(&pod, w, options); err != nil {
|
||||
return err
|
||||
|
@ -620,7 +620,7 @@ func printPodList(podList *api.PodList, w io.Writer, options printOptions) error
|
|||
return nil
|
||||
}
|
||||
|
||||
func printPodTemplate(pod *api.PodTemplate, w io.Writer, options printOptions) error {
|
||||
func printPodTemplate(pod *api.PodTemplate, w io.Writer, options PrintOptions) error {
|
||||
name := pod.Name
|
||||
namespace := pod.Namespace
|
||||
|
||||
|
@ -630,7 +630,7 @@ func printPodTemplate(pod *api.PodTemplate, w io.Writer, options printOptions) e
|
|||
firstContainer, containers = containers[0], containers[1:]
|
||||
}
|
||||
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -643,13 +643,13 @@ func printPodTemplate(pod *api.PodTemplate, w io.Writer, options printOptions) e
|
|||
); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := fmt.Fprint(w, appendLabels(pod.Labels, options.columnLabels)); err != nil {
|
||||
if _, err := fmt.Fprint(w, appendLabels(pod.Labels, options.ColumnLabels)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Lay out all the other containers on separate lines.
|
||||
extraLinePrefix := "\t"
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
extraLinePrefix = "\t\t"
|
||||
}
|
||||
for _, container := range containers {
|
||||
|
@ -657,14 +657,14 @@ func printPodTemplate(pod *api.PodTemplate, w io.Writer, options printOptions) e
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := fmt.Fprint(w, appendLabelTabs(options.columnLabels)); err != nil {
|
||||
if _, err := fmt.Fprint(w, appendLabelTabs(options.ColumnLabels)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printPodTemplateList(podList *api.PodTemplateList, w io.Writer, options printOptions) error {
|
||||
func printPodTemplateList(podList *api.PodTemplateList, w io.Writer, options PrintOptions) error {
|
||||
for _, pod := range podList.Items {
|
||||
if err := printPodTemplate(&pod, w, options); err != nil {
|
||||
return err
|
||||
|
@ -673,7 +673,7 @@ func printPodTemplateList(podList *api.PodTemplateList, w io.Writer, options pri
|
|||
return nil
|
||||
}
|
||||
|
||||
func printReplicationController(controller *api.ReplicationController, w io.Writer, options printOptions) error {
|
||||
func printReplicationController(controller *api.ReplicationController, w io.Writer, options PrintOptions) error {
|
||||
name := controller.Name
|
||||
namespace := controller.Namespace
|
||||
containers := controller.Spec.Template.Spec.Containers
|
||||
|
@ -682,7 +682,7 @@ func printReplicationController(controller *api.ReplicationController, w io.Writ
|
|||
firstContainer, containers = containers[0], containers[1:]
|
||||
}
|
||||
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -697,13 +697,13 @@ func printReplicationController(controller *api.ReplicationController, w io.Writ
|
|||
); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := fmt.Fprint(w, appendLabels(controller.Labels, options.columnLabels)); err != nil {
|
||||
if _, err := fmt.Fprint(w, appendLabels(controller.Labels, options.ColumnLabels)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Lay out all the other containers on separate lines.
|
||||
extraLinePrefix := "\t"
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
extraLinePrefix = "\t\t"
|
||||
}
|
||||
for _, container := range containers {
|
||||
|
@ -711,14 +711,14 @@ func printReplicationController(controller *api.ReplicationController, w io.Writ
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := fmt.Fprint(w, appendLabelTabs(options.columnLabels)); err != nil {
|
||||
if _, err := fmt.Fprint(w, appendLabelTabs(options.ColumnLabels)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printReplicationControllerList(list *api.ReplicationControllerList, w io.Writer, options printOptions) error {
|
||||
func printReplicationControllerList(list *api.ReplicationControllerList, w io.Writer, options PrintOptions) error {
|
||||
for _, controller := range list.Items {
|
||||
if err := printReplicationController(&controller, w, options); err != nil {
|
||||
return err
|
||||
|
@ -727,7 +727,7 @@ func printReplicationControllerList(list *api.ReplicationControllerList, w io.Wr
|
|||
return nil
|
||||
}
|
||||
|
||||
func printJob(job *extensions.Job, w io.Writer, options printOptions) error {
|
||||
func printJob(job *extensions.Job, w io.Writer, options PrintOptions) error {
|
||||
name := job.Name
|
||||
namespace := job.Namespace
|
||||
containers := job.Spec.Template.Spec.Containers
|
||||
|
@ -735,7 +735,7 @@ func printJob(job *extensions.Job, w io.Writer, options printOptions) error {
|
|||
if len(containers) > 0 {
|
||||
firstContainer, containers = containers[0], containers[1:]
|
||||
}
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -751,13 +751,13 @@ func printJob(job *extensions.Job, w io.Writer, options printOptions) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := fmt.Fprint(w, appendLabels(job.Labels, options.columnLabels)); err != nil {
|
||||
if _, err := fmt.Fprint(w, appendLabels(job.Labels, options.ColumnLabels)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Lay out all the other containers on separate lines.
|
||||
extraLinePrefix := "\t"
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
extraLinePrefix = "\t\t"
|
||||
}
|
||||
for _, container := range containers {
|
||||
|
@ -765,14 +765,14 @@ func printJob(job *extensions.Job, w io.Writer, options printOptions) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := fmt.Fprint(w, appendLabelTabs(options.columnLabels)); err != nil {
|
||||
if _, err := fmt.Fprint(w, appendLabelTabs(options.ColumnLabels)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printJobList(list *extensions.JobList, w io.Writer, options printOptions) error {
|
||||
func printJobList(list *extensions.JobList, w io.Writer, options PrintOptions) error {
|
||||
for _, job := range list.Items {
|
||||
if err := printJob(&job, w, options); err != nil {
|
||||
return err
|
||||
|
@ -825,14 +825,14 @@ func makePortString(ports []api.ServicePort) string {
|
|||
return strings.Join(pieces, ",")
|
||||
}
|
||||
|
||||
func printService(svc *api.Service, w io.Writer, options printOptions) error {
|
||||
func printService(svc *api.Service, w io.Writer, options PrintOptions) error {
|
||||
name := svc.Name
|
||||
namespace := svc.Namespace
|
||||
|
||||
internalIP := svc.Spec.ClusterIP
|
||||
externalIP := getServiceExternalIP(svc)
|
||||
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -847,13 +847,13 @@ func printService(svc *api.Service, w io.Writer, options printOptions) error {
|
|||
); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := fmt.Fprint(w, appendLabels(svc.Labels, options.columnLabels)); err != nil {
|
||||
if _, err := fmt.Fprint(w, appendLabels(svc.Labels, options.ColumnLabels)); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printServiceList(list *api.ServiceList, w io.Writer, options printOptions) error {
|
||||
func printServiceList(list *api.ServiceList, w io.Writer, options PrintOptions) error {
|
||||
for _, svc := range list.Items {
|
||||
if err := printService(&svc, w, options); err != nil {
|
||||
return err
|
||||
|
@ -870,12 +870,12 @@ func backendStringer(backend *extensions.IngressBackend) string {
|
|||
return fmt.Sprintf("%v:%v", backend.ServiceName, backend.ServicePort.String())
|
||||
}
|
||||
|
||||
func printIngress(ingress *extensions.Ingress, w io.Writer, options printOptions) error {
|
||||
func printIngress(ingress *extensions.Ingress, w io.Writer, options PrintOptions) error {
|
||||
name := ingress.Name
|
||||
namespace := ingress.Namespace
|
||||
|
||||
hostRules := ingress.Spec.Rules
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -891,7 +891,7 @@ func printIngress(ingress *extensions.Ingress, w io.Writer, options printOptions
|
|||
|
||||
// Lay out all the rules on separate lines.
|
||||
extraLinePrefix := ""
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
extraLinePrefix = "\t"
|
||||
}
|
||||
for _, rules := range hostRules {
|
||||
|
@ -902,7 +902,7 @@ func printIngress(ingress *extensions.Ingress, w io.Writer, options printOptions
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := fmt.Fprint(w, appendLabelTabs(options.columnLabels)); err != nil {
|
||||
if _, err := fmt.Fprint(w, appendLabelTabs(options.ColumnLabels)); err != nil {
|
||||
return err
|
||||
}
|
||||
for _, rule := range rules.HTTP.Paths {
|
||||
|
@ -910,7 +910,7 @@ func printIngress(ingress *extensions.Ingress, w io.Writer, options printOptions
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := fmt.Fprint(w, appendLabelTabs(options.columnLabels)); err != nil {
|
||||
if _, err := fmt.Fprint(w, appendLabelTabs(options.ColumnLabels)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
@ -918,7 +918,7 @@ func printIngress(ingress *extensions.Ingress, w io.Writer, options printOptions
|
|||
return nil
|
||||
}
|
||||
|
||||
func printIngressList(ingressList *extensions.IngressList, w io.Writer, options printOptions) error {
|
||||
func printIngressList(ingressList *extensions.IngressList, w io.Writer, options PrintOptions) error {
|
||||
for _, ingress := range ingressList.Items {
|
||||
if err := printIngress(&ingress, w, options); err != nil {
|
||||
return err
|
||||
|
@ -927,7 +927,7 @@ func printIngressList(ingressList *extensions.IngressList, w io.Writer, options
|
|||
return nil
|
||||
}
|
||||
|
||||
func printDaemonSet(ds *extensions.DaemonSet, w io.Writer, options printOptions) error {
|
||||
func printDaemonSet(ds *extensions.DaemonSet, w io.Writer, options PrintOptions) error {
|
||||
name := ds.Name
|
||||
namespace := ds.Namespace
|
||||
|
||||
|
@ -937,7 +937,7 @@ func printDaemonSet(ds *extensions.DaemonSet, w io.Writer, options printOptions)
|
|||
firstContainer, containers = containers[0], containers[1:]
|
||||
}
|
||||
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -956,13 +956,13 @@ func printDaemonSet(ds *extensions.DaemonSet, w io.Writer, options printOptions)
|
|||
); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := fmt.Fprint(w, appendLabels(ds.Labels, options.columnLabels)); err != nil {
|
||||
if _, err := fmt.Fprint(w, appendLabels(ds.Labels, options.ColumnLabels)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Lay out all the other containers on separate lines.
|
||||
extraLinePrefix := "\t"
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
extraLinePrefix = "\t\t"
|
||||
}
|
||||
for _, container := range containers {
|
||||
|
@ -970,14 +970,14 @@ func printDaemonSet(ds *extensions.DaemonSet, w io.Writer, options printOptions)
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := fmt.Fprint(w, appendLabelTabs(options.columnLabels)); err != nil {
|
||||
if _, err := fmt.Fprint(w, appendLabelTabs(options.ColumnLabels)); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func printDaemonSetList(list *extensions.DaemonSetList, w io.Writer, options printOptions) error {
|
||||
func printDaemonSetList(list *extensions.DaemonSetList, w io.Writer, options PrintOptions) error {
|
||||
for _, ds := range list.Items {
|
||||
if err := printDaemonSet(&ds, w, options); err != nil {
|
||||
return err
|
||||
|
@ -986,11 +986,11 @@ func printDaemonSetList(list *extensions.DaemonSetList, w io.Writer, options pri
|
|||
return nil
|
||||
}
|
||||
|
||||
func printEndpoints(endpoints *api.Endpoints, w io.Writer, options printOptions) error {
|
||||
func printEndpoints(endpoints *api.Endpoints, w io.Writer, options PrintOptions) error {
|
||||
name := endpoints.Name
|
||||
namespace := endpoints.Namespace
|
||||
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -998,11 +998,11 @@ func printEndpoints(endpoints *api.Endpoints, w io.Writer, options printOptions)
|
|||
if _, err := fmt.Fprintf(w, "%s\t%s\t%s", name, formatEndpoints(endpoints, nil), translateTimestamp(endpoints.CreationTimestamp)); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := fmt.Fprint(w, appendLabels(endpoints.Labels, options.columnLabels))
|
||||
_, err := fmt.Fprint(w, appendLabels(endpoints.Labels, options.ColumnLabels))
|
||||
return err
|
||||
}
|
||||
|
||||
func printEndpointsList(list *api.EndpointsList, w io.Writer, options printOptions) error {
|
||||
func printEndpointsList(list *api.EndpointsList, w io.Writer, options PrintOptions) error {
|
||||
for _, item := range list.Items {
|
||||
if err := printEndpoints(&item, w, options); err != nil {
|
||||
return err
|
||||
|
@ -1011,19 +1011,19 @@ func printEndpointsList(list *api.EndpointsList, w io.Writer, options printOptio
|
|||
return nil
|
||||
}
|
||||
|
||||
func printNamespace(item *api.Namespace, w io.Writer, options printOptions) error {
|
||||
if options.withNamespace {
|
||||
func printNamespace(item *api.Namespace, w io.Writer, options PrintOptions) error {
|
||||
if options.WithNamespace {
|
||||
return fmt.Errorf("namespace is not namespaced")
|
||||
}
|
||||
|
||||
if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s", item.Name, labels.FormatLabels(item.Labels), item.Status.Phase, translateTimestamp(item.CreationTimestamp)); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := fmt.Fprint(w, appendLabels(item.Labels, options.columnLabels))
|
||||
_, err := fmt.Fprint(w, appendLabels(item.Labels, options.ColumnLabels))
|
||||
return err
|
||||
}
|
||||
|
||||
func printNamespaceList(list *api.NamespaceList, w io.Writer, options printOptions) error {
|
||||
func printNamespaceList(list *api.NamespaceList, w io.Writer, options PrintOptions) error {
|
||||
for _, item := range list.Items {
|
||||
if err := printNamespace(&item, w, options); err != nil {
|
||||
return err
|
||||
|
@ -1032,11 +1032,11 @@ func printNamespaceList(list *api.NamespaceList, w io.Writer, options printOptio
|
|||
return nil
|
||||
}
|
||||
|
||||
func printSecret(item *api.Secret, w io.Writer, options printOptions) error {
|
||||
func printSecret(item *api.Secret, w io.Writer, options PrintOptions) error {
|
||||
name := item.Name
|
||||
namespace := item.Namespace
|
||||
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -1044,11 +1044,11 @@ func printSecret(item *api.Secret, w io.Writer, options printOptions) error {
|
|||
if _, err := fmt.Fprintf(w, "%s\t%s\t%v\t%s", name, item.Type, len(item.Data), translateTimestamp(item.CreationTimestamp)); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := fmt.Fprint(w, appendLabels(item.Labels, options.columnLabels))
|
||||
_, err := fmt.Fprint(w, appendLabels(item.Labels, options.ColumnLabels))
|
||||
return err
|
||||
}
|
||||
|
||||
func printSecretList(list *api.SecretList, w io.Writer, options printOptions) error {
|
||||
func printSecretList(list *api.SecretList, w io.Writer, options PrintOptions) error {
|
||||
for _, item := range list.Items {
|
||||
if err := printSecret(&item, w, options); err != nil {
|
||||
return err
|
||||
|
@ -1058,11 +1058,11 @@ func printSecretList(list *api.SecretList, w io.Writer, options printOptions) er
|
|||
return nil
|
||||
}
|
||||
|
||||
func printServiceAccount(item *api.ServiceAccount, w io.Writer, options printOptions) error {
|
||||
func printServiceAccount(item *api.ServiceAccount, w io.Writer, options PrintOptions) error {
|
||||
name := item.Name
|
||||
namespace := item.Namespace
|
||||
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -1070,11 +1070,11 @@ func printServiceAccount(item *api.ServiceAccount, w io.Writer, options printOpt
|
|||
if _, err := fmt.Fprintf(w, "%s\t%d\t%s", name, len(item.Secrets), translateTimestamp(item.CreationTimestamp)); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := fmt.Fprint(w, appendLabels(item.Labels, options.columnLabels))
|
||||
_, err := fmt.Fprint(w, appendLabels(item.Labels, options.ColumnLabels))
|
||||
return err
|
||||
}
|
||||
|
||||
func printServiceAccountList(list *api.ServiceAccountList, w io.Writer, options printOptions) error {
|
||||
func printServiceAccountList(list *api.ServiceAccountList, w io.Writer, options PrintOptions) error {
|
||||
for _, item := range list.Items {
|
||||
if err := printServiceAccount(&item, w, options); err != nil {
|
||||
return err
|
||||
|
@ -1084,8 +1084,8 @@ func printServiceAccountList(list *api.ServiceAccountList, w io.Writer, options
|
|||
return nil
|
||||
}
|
||||
|
||||
func printNode(node *api.Node, w io.Writer, options printOptions) error {
|
||||
if options.withNamespace {
|
||||
func printNode(node *api.Node, w io.Writer, options PrintOptions) error {
|
||||
if options.WithNamespace {
|
||||
return fmt.Errorf("node is not namespaced")
|
||||
}
|
||||
conditionMap := make(map[api.NodeConditionType]*api.NodeCondition)
|
||||
|
@ -1114,11 +1114,11 @@ func printNode(node *api.Node, w io.Writer, options printOptions) error {
|
|||
if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s", node.Name, labels.FormatLabels(node.Labels), strings.Join(status, ","), translateTimestamp(node.CreationTimestamp)); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := fmt.Fprint(w, appendLabels(node.Labels, options.columnLabels))
|
||||
_, err := fmt.Fprint(w, appendLabels(node.Labels, options.ColumnLabels))
|
||||
return err
|
||||
}
|
||||
|
||||
func printNodeList(list *api.NodeList, w io.Writer, options printOptions) error {
|
||||
func printNodeList(list *api.NodeList, w io.Writer, options PrintOptions) error {
|
||||
for _, node := range list.Items {
|
||||
if err := printNode(&node, w, options); err != nil {
|
||||
return err
|
||||
|
@ -1127,8 +1127,8 @@ func printNodeList(list *api.NodeList, w io.Writer, options printOptions) error
|
|||
return nil
|
||||
}
|
||||
|
||||
func printPersistentVolume(pv *api.PersistentVolume, w io.Writer, options printOptions) error {
|
||||
if options.withNamespace {
|
||||
func printPersistentVolume(pv *api.PersistentVolume, w io.Writer, options PrintOptions) error {
|
||||
if options.WithNamespace {
|
||||
return fmt.Errorf("persistentVolume is not namespaced")
|
||||
}
|
||||
name := pv.Name
|
||||
|
@ -1156,11 +1156,11 @@ func printPersistentVolume(pv *api.PersistentVolume, w io.Writer, options printO
|
|||
); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := fmt.Fprint(w, appendLabels(pv.Labels, options.columnLabels))
|
||||
_, err := fmt.Fprint(w, appendLabels(pv.Labels, options.ColumnLabels))
|
||||
return err
|
||||
}
|
||||
|
||||
func printPersistentVolumeList(list *api.PersistentVolumeList, w io.Writer, options printOptions) error {
|
||||
func printPersistentVolumeList(list *api.PersistentVolumeList, w io.Writer, options PrintOptions) error {
|
||||
for _, pv := range list.Items {
|
||||
if err := printPersistentVolume(&pv, w, options); err != nil {
|
||||
return err
|
||||
|
@ -1169,11 +1169,11 @@ func printPersistentVolumeList(list *api.PersistentVolumeList, w io.Writer, opti
|
|||
return nil
|
||||
}
|
||||
|
||||
func printPersistentVolumeClaim(pvc *api.PersistentVolumeClaim, w io.Writer, options printOptions) error {
|
||||
func printPersistentVolumeClaim(pvc *api.PersistentVolumeClaim, w io.Writer, options PrintOptions) error {
|
||||
name := pvc.Name
|
||||
namespace := pvc.Namespace
|
||||
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -1193,11 +1193,11 @@ func printPersistentVolumeClaim(pvc *api.PersistentVolumeClaim, w io.Writer, opt
|
|||
if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s", name, labels, phase, pvc.Spec.VolumeName, capacity, accessModes, translateTimestamp(pvc.CreationTimestamp)); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := fmt.Fprint(w, appendLabels(pvc.Labels, options.columnLabels))
|
||||
_, err := fmt.Fprint(w, appendLabels(pvc.Labels, options.ColumnLabels))
|
||||
return err
|
||||
}
|
||||
|
||||
func printPersistentVolumeClaimList(list *api.PersistentVolumeClaimList, w io.Writer, options printOptions) error {
|
||||
func printPersistentVolumeClaimList(list *api.PersistentVolumeClaimList, w io.Writer, options PrintOptions) error {
|
||||
for _, psd := range list.Items {
|
||||
if err := printPersistentVolumeClaim(&psd, w, options); err != nil {
|
||||
return err
|
||||
|
@ -1206,9 +1206,9 @@ func printPersistentVolumeClaimList(list *api.PersistentVolumeClaimList, w io.Wr
|
|||
return nil
|
||||
}
|
||||
|
||||
func printEvent(event *api.Event, w io.Writer, options printOptions) error {
|
||||
func printEvent(event *api.Event, w io.Writer, options PrintOptions) error {
|
||||
namespace := event.Namespace
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -1216,7 +1216,7 @@ func printEvent(event *api.Event, w io.Writer, options printOptions) error {
|
|||
|
||||
// While watching event, we should print absolute time.
|
||||
var FirstTimestamp, LastTimestamp string
|
||||
if options.absoluteTimestamps {
|
||||
if options.AbsoluteTimestamps {
|
||||
FirstTimestamp = event.FirstTimestamp.String()
|
||||
LastTimestamp = event.LastTimestamp.String()
|
||||
} else {
|
||||
|
@ -1239,12 +1239,12 @@ func printEvent(event *api.Event, w io.Writer, options printOptions) error {
|
|||
); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := fmt.Fprint(w, appendLabels(event.Labels, options.columnLabels))
|
||||
_, err := fmt.Fprint(w, appendLabels(event.Labels, options.ColumnLabels))
|
||||
return err
|
||||
}
|
||||
|
||||
// Sorts and prints the EventList in a human-friendly format.
|
||||
func printEventList(list *api.EventList, w io.Writer, options printOptions) error {
|
||||
func printEventList(list *api.EventList, w io.Writer, options PrintOptions) error {
|
||||
sort.Sort(SortableEvents(list.Items))
|
||||
for i := range list.Items {
|
||||
if err := printEvent(&list.Items[i], w, options); err != nil {
|
||||
|
@ -1254,11 +1254,11 @@ func printEventList(list *api.EventList, w io.Writer, options printOptions) erro
|
|||
return nil
|
||||
}
|
||||
|
||||
func printLimitRange(limitRange *api.LimitRange, w io.Writer, options printOptions) error {
|
||||
func printLimitRange(limitRange *api.LimitRange, w io.Writer, options PrintOptions) error {
|
||||
name := limitRange.Name
|
||||
namespace := limitRange.Namespace
|
||||
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -1271,12 +1271,12 @@ func printLimitRange(limitRange *api.LimitRange, w io.Writer, options printOptio
|
|||
); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := fmt.Fprint(w, appendLabels(limitRange.Labels, options.columnLabels))
|
||||
_, err := fmt.Fprint(w, appendLabels(limitRange.Labels, options.ColumnLabels))
|
||||
return err
|
||||
}
|
||||
|
||||
// Prints the LimitRangeList in a human-friendly format.
|
||||
func printLimitRangeList(list *api.LimitRangeList, w io.Writer, options printOptions) error {
|
||||
func printLimitRangeList(list *api.LimitRangeList, w io.Writer, options PrintOptions) error {
|
||||
for i := range list.Items {
|
||||
if err := printLimitRange(&list.Items[i], w, options); err != nil {
|
||||
return err
|
||||
|
@ -1285,11 +1285,11 @@ func printLimitRangeList(list *api.LimitRangeList, w io.Writer, options printOpt
|
|||
return nil
|
||||
}
|
||||
|
||||
func printResourceQuota(resourceQuota *api.ResourceQuota, w io.Writer, options printOptions) error {
|
||||
func printResourceQuota(resourceQuota *api.ResourceQuota, w io.Writer, options PrintOptions) error {
|
||||
name := resourceQuota.Name
|
||||
namespace := resourceQuota.Namespace
|
||||
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -1302,12 +1302,12 @@ func printResourceQuota(resourceQuota *api.ResourceQuota, w io.Writer, options p
|
|||
); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := fmt.Fprint(w, appendLabels(resourceQuota.Labels, options.columnLabels))
|
||||
_, err := fmt.Fprint(w, appendLabels(resourceQuota.Labels, options.ColumnLabels))
|
||||
return err
|
||||
}
|
||||
|
||||
// Prints the ResourceQuotaList in a human-friendly format.
|
||||
func printResourceQuotaList(list *api.ResourceQuotaList, w io.Writer, options printOptions) error {
|
||||
func printResourceQuotaList(list *api.ResourceQuotaList, w io.Writer, options PrintOptions) error {
|
||||
for i := range list.Items {
|
||||
if err := printResourceQuota(&list.Items[i], w, options); err != nil {
|
||||
return err
|
||||
|
@ -1316,8 +1316,8 @@ func printResourceQuotaList(list *api.ResourceQuotaList, w io.Writer, options pr
|
|||
return nil
|
||||
}
|
||||
|
||||
func printComponentStatus(item *api.ComponentStatus, w io.Writer, options printOptions) error {
|
||||
if options.withNamespace {
|
||||
func printComponentStatus(item *api.ComponentStatus, w io.Writer, options PrintOptions) error {
|
||||
if options.WithNamespace {
|
||||
return fmt.Errorf("componentStatus is not namespaced")
|
||||
}
|
||||
status := "Unknown"
|
||||
|
@ -1339,11 +1339,11 @@ func printComponentStatus(item *api.ComponentStatus, w io.Writer, options printO
|
|||
if _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s", item.Name, status, message, error); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := fmt.Fprint(w, appendLabels(item.Labels, options.columnLabels))
|
||||
_, err := fmt.Fprint(w, appendLabels(item.Labels, options.ColumnLabels))
|
||||
return err
|
||||
}
|
||||
|
||||
func printComponentStatusList(list *api.ComponentStatusList, w io.Writer, options printOptions) error {
|
||||
func printComponentStatusList(list *api.ComponentStatusList, w io.Writer, options PrintOptions) error {
|
||||
for _, item := range list.Items {
|
||||
if err := printComponentStatus(&item, w, options); err != nil {
|
||||
return err
|
||||
|
@ -1353,7 +1353,7 @@ func printComponentStatusList(list *api.ComponentStatusList, w io.Writer, option
|
|||
return nil
|
||||
}
|
||||
|
||||
func printThirdPartyResource(rsrc *extensions.ThirdPartyResource, w io.Writer, options printOptions) error {
|
||||
func printThirdPartyResource(rsrc *extensions.ThirdPartyResource, w io.Writer, options PrintOptions) error {
|
||||
versions := make([]string, len(rsrc.Versions))
|
||||
for ix := range rsrc.Versions {
|
||||
version := &rsrc.Versions[ix]
|
||||
|
@ -1366,7 +1366,7 @@ func printThirdPartyResource(rsrc *extensions.ThirdPartyResource, w io.Writer, o
|
|||
return nil
|
||||
}
|
||||
|
||||
func printThirdPartyResourceList(list *extensions.ThirdPartyResourceList, w io.Writer, options printOptions) error {
|
||||
func printThirdPartyResourceList(list *extensions.ThirdPartyResourceList, w io.Writer, options PrintOptions) error {
|
||||
for _, item := range list.Items {
|
||||
if err := printThirdPartyResource(&item, w, options); err != nil {
|
||||
return err
|
||||
|
@ -1376,8 +1376,8 @@ func printThirdPartyResourceList(list *extensions.ThirdPartyResourceList, w io.W
|
|||
return nil
|
||||
}
|
||||
|
||||
func printDeployment(deployment *extensions.Deployment, w io.Writer, options printOptions) error {
|
||||
if options.withNamespace {
|
||||
func printDeployment(deployment *extensions.Deployment, w io.Writer, options PrintOptions) error {
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", deployment.Namespace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -1388,11 +1388,11 @@ func printDeployment(deployment *extensions.Deployment, w io.Writer, options pri
|
|||
if _, err := fmt.Fprintf(w, "%s\t%s\t%s", deployment.Name, updatedReplicas, age); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := fmt.Fprint(w, appendLabels(deployment.Labels, options.columnLabels))
|
||||
_, err := fmt.Fprint(w, appendLabels(deployment.Labels, options.ColumnLabels))
|
||||
return err
|
||||
}
|
||||
|
||||
func printDeploymentList(list *extensions.DeploymentList, w io.Writer, options printOptions) error {
|
||||
func printDeploymentList(list *extensions.DeploymentList, w io.Writer, options PrintOptions) error {
|
||||
for _, item := range list.Items {
|
||||
if err := printDeployment(&item, w, options); err != nil {
|
||||
return err
|
||||
|
@ -1401,7 +1401,7 @@ func printDeploymentList(list *extensions.DeploymentList, w io.Writer, options p
|
|||
return nil
|
||||
}
|
||||
|
||||
func printHorizontalPodAutoscaler(hpa *extensions.HorizontalPodAutoscaler, w io.Writer, options printOptions) error {
|
||||
func printHorizontalPodAutoscaler(hpa *extensions.HorizontalPodAutoscaler, w io.Writer, options PrintOptions) error {
|
||||
namespace := hpa.Namespace
|
||||
name := hpa.Name
|
||||
reference := fmt.Sprintf("%s/%s/%s",
|
||||
|
@ -1421,7 +1421,7 @@ func printHorizontalPodAutoscaler(hpa *extensions.HorizontalPodAutoscaler, w io.
|
|||
minPods = fmt.Sprintf("%d", *hpa.Spec.MinReplicas)
|
||||
}
|
||||
maxPods := hpa.Spec.MaxReplicas
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -1438,11 +1438,11 @@ func printHorizontalPodAutoscaler(hpa *extensions.HorizontalPodAutoscaler, w io.
|
|||
); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := fmt.Fprint(w, appendLabels(hpa.Labels, options.columnLabels))
|
||||
_, err := fmt.Fprint(w, appendLabels(hpa.Labels, options.ColumnLabels))
|
||||
return err
|
||||
}
|
||||
|
||||
func printHorizontalPodAutoscalerList(list *extensions.HorizontalPodAutoscalerList, w io.Writer, options printOptions) error {
|
||||
func printHorizontalPodAutoscalerList(list *extensions.HorizontalPodAutoscalerList, w io.Writer, options PrintOptions) error {
|
||||
for i := range list.Items {
|
||||
if err := printHorizontalPodAutoscaler(&list.Items[i], w, options); err != nil {
|
||||
return err
|
||||
|
@ -1451,11 +1451,11 @@ func printHorizontalPodAutoscalerList(list *extensions.HorizontalPodAutoscalerLi
|
|||
return nil
|
||||
}
|
||||
|
||||
func printConfigMap(configMap *api.ConfigMap, w io.Writer, options printOptions) error {
|
||||
func printConfigMap(configMap *api.ConfigMap, w io.Writer, options PrintOptions) error {
|
||||
name := configMap.Name
|
||||
namespace := configMap.Namespace
|
||||
|
||||
if options.withNamespace {
|
||||
if options.WithNamespace {
|
||||
if _, err := fmt.Fprintf(w, "%s\t", namespace); err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -1463,11 +1463,11 @@ func printConfigMap(configMap *api.ConfigMap, w io.Writer, options printOptions)
|
|||
if _, err := fmt.Fprintf(w, "%s\t%v\t%s", name, len(configMap.Data), translateTimestamp(configMap.CreationTimestamp)); err != nil {
|
||||
return err
|
||||
}
|
||||
_, err := fmt.Fprint(w, appendLabels(configMap.Labels, options.columnLabels))
|
||||
_, err := fmt.Fprint(w, appendLabels(configMap.Labels, options.ColumnLabels))
|
||||
return err
|
||||
}
|
||||
|
||||
func printConfigMapList(list *api.ConfigMapList, w io.Writer, options printOptions) error {
|
||||
func printConfigMapList(list *api.ConfigMapList, w io.Writer, options PrintOptions) error {
|
||||
for i := range list.Items {
|
||||
if err := printConfigMap(&list.Items[i], w, options); err != nil {
|
||||
return err
|
||||
|
@ -1542,10 +1542,10 @@ func (h *HumanReadablePrinter) PrintObj(obj runtime.Object, output io.Writer) er
|
|||
}
|
||||
t := reflect.TypeOf(obj)
|
||||
if handler := h.handlerMap[t]; handler != nil {
|
||||
if !h.options.noHeaders && t != h.lastType {
|
||||
headers := append(handler.columns, formatWideHeaders(h.options.wide, t)...)
|
||||
headers = append(headers, formatLabelHeaders(h.options.columnLabels)...)
|
||||
if h.options.withNamespace {
|
||||
if !h.options.NoHeaders && t != h.lastType {
|
||||
headers := append(handler.columns, formatWideHeaders(h.options.Wide, t)...)
|
||||
headers = append(headers, formatLabelHeaders(h.options.ColumnLabels)...)
|
||||
if h.options.WithNamespace {
|
||||
headers = append(withNamespacePrefixColumns, headers...)
|
||||
}
|
||||
h.printHeader(headers, w)
|
||||
|
|
|
@ -213,12 +213,12 @@ func TestJSONPrinter(t *testing.T) {
|
|||
testPrinter(t, &JSONPrinter{}, json.Unmarshal)
|
||||
}
|
||||
|
||||
func PrintCustomType(obj *TestPrintType, w io.Writer, options printOptions) error {
|
||||
func PrintCustomType(obj *TestPrintType, w io.Writer, options PrintOptions) error {
|
||||
_, err := fmt.Fprintf(w, "%s", obj.Data)
|
||||
return err
|
||||
}
|
||||
|
||||
func ErrorPrintHandler(obj *TestPrintType, w io.Writer, options printOptions) error {
|
||||
func ErrorPrintHandler(obj *TestPrintType, w io.Writer, options PrintOptions) error {
|
||||
return fmt.Errorf("ErrorPrintHandler error")
|
||||
}
|
||||
|
||||
|
@ -755,7 +755,7 @@ func TestPrintHumanReadableService(t *testing.T) {
|
|||
|
||||
for _, svc := range tests {
|
||||
buff := bytes.Buffer{}
|
||||
printService(&svc, &buff, printOptions{false, false, false, false, false, []string{}})
|
||||
printService(&svc, &buff, PrintOptions{false, false, false, false, false, []string{}})
|
||||
output := string(buff.Bytes())
|
||||
ip := svc.Spec.ClusterIP
|
||||
if !strings.Contains(output, ip) {
|
||||
|
@ -1044,7 +1044,7 @@ func TestPrintPod(t *testing.T) {
|
|||
|
||||
buf := bytes.NewBuffer([]byte{})
|
||||
for _, test := range tests {
|
||||
printPod(&test.pod, buf, printOptions{false, false, false, true, false, []string{}})
|
||||
printPod(&test.pod, buf, PrintOptions{false, false, false, true, false, []string{}})
|
||||
// We ignore time
|
||||
if !strings.HasPrefix(buf.String(), test.expect) {
|
||||
t.Fatalf("Expected: %s, got: %s", test.expect, buf.String())
|
||||
|
@ -1137,7 +1137,7 @@ func TestPrintNonTerminatedPod(t *testing.T) {
|
|||
|
||||
buf := bytes.NewBuffer([]byte{})
|
||||
for _, test := range tests {
|
||||
printPod(&test.pod, buf, printOptions{false, false, false, false, false, []string{}})
|
||||
printPod(&test.pod, buf, PrintOptions{false, false, false, false, false, []string{}})
|
||||
// We ignore time
|
||||
if !strings.HasPrefix(buf.String(), test.expect) {
|
||||
t.Fatalf("Expected: %s, got: %s", test.expect, buf.String())
|
||||
|
@ -1197,7 +1197,7 @@ func TestPrintPodWithLabels(t *testing.T) {
|
|||
|
||||
buf := bytes.NewBuffer([]byte{})
|
||||
for _, test := range tests {
|
||||
printPod(&test.pod, buf, printOptions{false, false, false, false, false, test.labelColumns})
|
||||
printPod(&test.pod, buf, PrintOptions{false, false, false, false, false, test.labelColumns})
|
||||
// We ignore time
|
||||
if !strings.HasPrefix(buf.String(), test.startsWith) || !strings.HasSuffix(buf.String(), test.endsWith) {
|
||||
t.Fatalf("Expected to start with: %s and end with: %s, but got: %s", test.startsWith, test.endsWith, buf.String())
|
||||
|
@ -1259,7 +1259,7 @@ func TestPrintDeployment(t *testing.T) {
|
|||
|
||||
buf := bytes.NewBuffer([]byte{})
|
||||
for _, test := range tests {
|
||||
printDeployment(&test.deployment, buf, printOptions{false, false, false, true, false, []string{}})
|
||||
printDeployment(&test.deployment, buf, PrintOptions{false, false, false, true, false, []string{}})
|
||||
if buf.String() != test.expect {
|
||||
t.Fatalf("Expected: %s, got: %s", test.expect, buf.String())
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue