From 49be0016e3ee44ea2a08d048ea10b6bd8ccff993 Mon Sep 17 00:00:00 2001 From: Fabian <46140201+phin1x@users.noreply.github.com> Date: Thu, 5 Mar 2020 16:30:33 +0100 Subject: [PATCH] fixed request and response structs --- cups-client.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cups-client.go b/cups-client.go index 862ccb1..f90d090 100644 --- a/cups-client.go +++ b/cups-client.go @@ -21,7 +21,7 @@ func (c *CUPSClient) GetDevices() (map[string]Attributes, error) { printerNameMap := make(map[string]Attributes) - for _, printerAttributes := range resp.Printers { + for _, printerAttributes := range resp.PrinterAttributes { printerNameMap[printerAttributes[PrinterAttributeDeviceURI][0].Value.(string)] = printerAttributes } @@ -56,7 +56,7 @@ func (c *CUPSClient) GetPPDs() (map[string]Attributes, error) { ppdNameMap := make(map[string]Attributes) - for _, printerAttributes := range resp.Printers { + for _, printerAttributes := range resp.PrinterAttributes { ppdNameMap[printerAttributes[OperationAttributePPDName][0].Value.(string)] = printerAttributes } @@ -240,7 +240,7 @@ func (c *CUPSClient) GetPrinters(attributes []string) (map[string]Attributes, er printerNameMap := make(map[string]Attributes) - for _, printerAttributes := range resp.Printers { + for _, printerAttributes := range resp.PrinterAttributes { printerNameMap[printerAttributes[PrinterAttributePrinterName][0].Value.(string)] = printerAttributes } @@ -263,7 +263,7 @@ func (c *CUPSClient) GetClasses(attributes []string) (map[string]Attributes, err printerNameMap := make(map[string]Attributes) - for _, printerAttributes := range resp.Printers { + for _, printerAttributes := range resp.PrinterAttributes { printerNameMap[printerAttributes[PrinterAttributePrinterName][0].Value.(string)] = printerAttributes }