From 822f93fbfeb0ee5500c357acb5a48c9b373b22cc Mon Sep 17 00:00:00 2001 From: phin1x Date: Sun, 25 Jun 2023 20:58:10 +0200 Subject: [PATCH] updated go.mod --- README.md | 9 ++++++--- go.mod | 2 +- go.sum | 17 +++++++++++++++++ 3 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 go.sum diff --git a/README.md b/README.md index da173fb..a6721b9 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ go get -u github.com/phin1x/go-ipp ## Features +* only depends on the standard go library (only dependency is for testing) * basic ipp 2.0 compatible Client * extended client for cups server * create custom ipp requests @@ -22,6 +23,7 @@ go get -u github.com/phin1x/go-ipp ## Example Print a file with the ipp client + ```go package main @@ -36,6 +38,7 @@ func main() { ``` Craft and send a custom request + ```go package main @@ -44,7 +47,7 @@ import "github.com/phin1x/go-ipp" func main() { // define a ipp request - req := ipp.NewRequest(OperationGetJobs, 1) + req := ipp.NewRequest(ipp.OperationGetJobs, 1) req.OperationAttributes[ipp.AttributeWhichJobs] = "completed" req.OperationAttributes[ipp.AttributeMyJobs] = myJobs req.OperationAttributes[ipp.AttributeFirstJobID] = 42 @@ -89,8 +92,8 @@ func main() { } // check if the response status is "ok" - if resp.StatusCode == ipp.StatusOk { - panic(resp.StatusCode) + if err := resp.CheckForErrors(); err != nil { + panic(err) } // do something with the returned data diff --git a/go.mod b/go.mod index ad49fbc..74ecc8e 100644 --- a/go.mod +++ b/go.mod @@ -2,4 +2,4 @@ module github.com/phin1x/go-ipp go 1.13 -require github.com/stretchr/testify v1.8.4 // indirect +require github.com/stretchr/testify v1.8.4 diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..479781e --- /dev/null +++ b/go.sum @@ -0,0 +1,17 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=