From 2ecd656eb1bdb941a2c989dc4982a0b851c7a32c Mon Sep 17 00:00:00 2001 From: the-goodies Date: Fri, 2 Apr 2021 21:38:19 +0300 Subject: [PATCH] Fix GetJobAttributes method GetJobAttributes was always returning: "server doesn't return any job attributes" in my case. Turns out it's because it wasn't returning the correct response value. This should fix this. --- ipp-client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ipp-client.go b/ipp-client.go index 0a992a8..1451746 100644 --- a/ipp-client.go +++ b/ipp-client.go @@ -231,11 +231,11 @@ func (c *IPPClient) GetJobAttributes(jobID int, attributes []string) (Attributes return nil, err } - if len(resp.PrinterAttributes) == 0 { + if len(resp.JobAttributes) == 0 { return nil, errors.New("server doesn't return any job attributes") } - return resp.PrinterAttributes[0], nil + return resp.JobAttributes[0], nil } // GetJobs returns jobs from a printer or class