code: func ListFormatWrite(ctx formatter.Context, services []swarm.Service, info map[string]ListInfo) error {
  	render := func(format func(subContext formatter.SubContext) error) error {
  		for _, service := range services {
  			serviceCtx := &serviceContext{service: service, mode: info[service.ID].Mode, replicas: info[service.ID].Replicas}
  			if err := format(serviceCtx); err != nil {
  				return err
  			}
  		}
  		return nil
  	}
  	serviceCtx := serviceContext{}
  	serviceCtx.Header = formatter.SubHeaderContext{
  		"ID":       serviceIDHeader,
  		"Name":     formatter.NameHeader,
  		"Mode":     modeHeader,
  		"Replicas": replicasHeader,
  		"Image":    formatter.ImageHeader,
  		"Ports":    formatter.PortsHeader,
  	}
  	return ctx.Write(&serviceCtx, render)
  }
docs: // ListFormatWrite writes the context