From 6b4297fbc08324601ccacc04d6207ab9d509b599 Mon Sep 17 00:00:00 2001 From: Augustin Husson Date: Fri, 5 Jun 2026 11:29:44 +0200 Subject: [PATCH 1/4] bump go to 1.25 and update go deps Signed-off-by: Augustin Husson --- go.mod | 34 ++++++++++---------- go.sum | 100 ++++++++++++++++++++++----------------------------------- 2 files changed, 55 insertions(+), 79 deletions(-) diff --git a/go.mod b/go.mod index 3f34a42c5..30dd6a0e5 100644 --- a/go.mod +++ b/go.mod @@ -1,46 +1,46 @@ module github.com/gavv/httpexpect/v2 -go 1.19 +go 1.25.0 require ( github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2 - github.com/ajg/form v1.5.1 - github.com/fasthttp/websocket v1.4.3-rc.6 - github.com/fatih/color v1.15.0 + github.com/ajg/form v1.7.1 + github.com/fasthttp/websocket v1.5.12 + github.com/fatih/color v1.19.0 github.com/fatih/structs v1.1.0 github.com/gobwas/glob v0.2.3 - github.com/google/go-querystring v1.1.0 - github.com/gorilla/websocket v1.4.2 + github.com/google/go-querystring v1.2.0 + github.com/gorilla/websocket v1.5.3 github.com/imkira/go-interpol v1.1.0 - github.com/mattn/go-isatty v0.0.18 + github.com/mattn/go-isatty v0.0.22 github.com/mitchellh/go-wordwrap v1.0.1 - github.com/sanity-io/litter v1.5.5 - github.com/stretchr/testify v1.6.0 - github.com/valyala/fasthttp v1.40.0 + github.com/sanity-io/litter v1.5.8 + github.com/stretchr/testify v1.11.1 + github.com/valyala/fasthttp v1.71.0 github.com/xeipuuv/gojsonschema v1.2.0 github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 github.com/yudai/gojsondiff v1.0.0 - golang.org/x/net v0.33.0 + golang.org/x/net v0.55.0 moul.io/http2curl/v2 v2.3.0 ) require ( - github.com/andybalholm/brotli v1.0.4 // indirect + github.com/andybalholm/brotli v1.2.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f // indirect - github.com/klauspost/compress v1.15.0 // indirect - github.com/mattn/go-colorable v0.1.13 // indirect + github.com/klauspost/compress v1.18.6 // indirect + github.com/mattn/go-colorable v0.1.14 // indirect github.com/onsi/ginkgo v1.10.1 // indirect github.com/onsi/gomega v1.7.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/savsgio/gotils v0.0.0-20210617111740-97865ed5a873 // indirect + github.com/savsgio/gotils v0.0.0-20240704082632-aef3928b8a38 // indirect github.com/sergi/go-diff v1.0.0 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect github.com/yudai/pp v2.0.1+incompatible // indirect - golang.org/x/sys v0.28.0 // indirect + golang.org/x/sys v0.45.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect - gopkg.in/yaml.v3 v3.0.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 019e93a8f..8e4ab8511 100644 --- a/go.sum +++ b/go.sum @@ -1,46 +1,41 @@ github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2 h1:ZBbLwSJqkHBuFDA6DUhhse0IGJ7T5bemHyNILUjvOq4= github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2/go.mod h1:VSw57q4QFiWDbRnjdX8Cb3Ow0SFncRw+bA/ofY6Q83w= -github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= -github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= -github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= -github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= -github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= +github.com/ajg/form v1.7.1 h1:OsnBDzTkrWdrxvEnO68I72ZVGJGNaMwPhoAm0V+llgc= +github.com/ajg/form v1.7.1/go.mod h1:HL757PzLyNkj5AIfptT6L+iGNeXTlnrr/oDePGc/y7Q= +github.com/andybalholm/brotli v1.2.1 h1:R+f5xP285VArJDRgowrfb9DqL18yVK0gKAW/F+eTWro= +github.com/andybalholm/brotli v1.2.1/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY= github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 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/fasthttp/websocket v1.4.3-rc.6 h1:omHqsl8j+KXpmzRjF8bmzOSYJ8GnS0E3efi1wYT+niY= -github.com/fasthttp/websocket v1.4.3-rc.6/go.mod h1:43W9OM2T8FeXpCWMsBd9Cb7nE2CACNqNvCqQCoty/Lc= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fasthttp/websocket v1.5.12 h1:e4RGPpWW2HTbL3zV0Y/t7g0ub294LkiuXXUuTOUInlE= +github.com/fasthttp/websocket v1.5.12/go.mod h1:I+liyL7/4moHojiOgUOIKEWm9EIxHqxZChS+aMFltyg= +github.com/fatih/color v1.19.0 h1:Zp3PiM21/9Ld6FzSKyL5c/BULoe/ONr9KlbYVOfG8+w= +github.com/fatih/color v1.19.0/go.mod h1:zNk67I0ZUT1bEGsSGyCZYZNrHuTkJJB+r6Q9VuMi0LE= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJAkT8= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/google/go-cmp v0.5.2 h1:X2ev0eStA3AbceY54o37/0PQ/UWqKEiiO2dKL5OPaFM= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= -github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0= +github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU= +github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= +github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f h1:7LYC+Yfkj3CTRcShK0KOL/w6iTiKyqqBA9a41Wnggw8= github.com/hokaccha/go-prettyjson v0.0.0-20211117102719-0474bc63780f/go.mod h1:pFlLw2CfqZiIBOx6BuCeRLCrfxBJipTY0nIOF/VbGcI= github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/imkira/go-interpol v1.1.0 h1:KIiKr0VSG2CUW1hl1jpiyuzuJeKUUpC8iM1AIE7N1Vk= github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA= -github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.15.0 h1:xqfchp4whNFxn5A4XFyyYtitiWI8Hy5EW59jEwcyL6U= -github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= -github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= -github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/klauspost/compress v1.18.6 h1:2jupLlAwFm95+YDR+NwD2MEfFO9d4z4Prjl1XXDjuao= +github.com/klauspost/compress v1.18.6/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= +github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= +github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= +github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4= +github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -52,25 +47,23 @@ github.com/pkg/diff v0.0.0-20200914180035-5b29258ca4f7/go.mod h1:zO8QMzTeZd5cpnI github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 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/sanity-io/litter v1.5.5 h1:iE+sBxPBzoK6uaEP5Lt3fHNgpKcHXc/A2HGETy0uJQo= -github.com/sanity-io/litter v1.5.5/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U= -github.com/savsgio/gotils v0.0.0-20210617111740-97865ed5a873 h1:N3Af8f13ooDKcIhsmFT7Z05CStZWu4C7Md0uDEy4q6o= -github.com/savsgio/gotils v0.0.0-20210617111740-97865ed5a873/go.mod h1:dmPawKuiAeG/aFYVs2i+Dyosoo7FNcm+Pi8iK6ZUrX8= +github.com/sanity-io/litter v1.5.8 h1:uM/2lKrWdGbRXDrIq08Lh9XtVYoeGtcQxk9rtQ7+rYg= +github.com/sanity-io/litter v1.5.8/go.mod h1:9gzJgR2i4ZpjZHsKvUXIRQVk7P+yM3e+jAF7bU2UI5U= +github.com/savsgio/gotils v0.0.0-20240704082632-aef3928b8a38 h1:D0vL7YNisV2yqE55+q0lFuGse6U8lxlg7fYTctlT5Gc= +github.com/savsgio/gotils v0.0.0-20240704082632-aef3928b8a38/go.mod h1:sM7Mt7uEoCeFSCBM+qBrqvEo+/9vdmj19wzp3yzUhmg= github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v0.0.0-20161117074351-18a02ba4a312/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/stretchr/testify v1.6.0 h1:jlIyCplCJFULU/01vCkhKuTyc3OorI3bJFuw6obfgho= -github.com/stretchr/testify v1.6.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/tailscale/depaware v0.0.0-20210622194025-720c4b409502/go.mod h1:p9lPsd+cx33L3H9nNoecRRxPssFKUwwI50I3pZ0yT+8= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= -github.com/valyala/fasthttp v1.27.0/go.mod h1:cmWIqlu99AO/RKcp1HWaViTqc57FswJOfYYdPJBl8BA= -github.com/valyala/fasthttp v1.40.0 h1:CRq/00MfruPGFLTQKY8b+8SfdK60TxNztjRMnH0t1Yc= -github.com/valyala/fasthttp v1.40.0/go.mod h1:t/G+3rLek+CyY9bnIE+YlMRddxVAAGjhxndDB4i4C0I= -github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= +github.com/valyala/fasthttp v1.71.0 h1:tepR7H+Guh9VUqxxcPggYi8R3lGUu2Rsdh+z7/FCY3k= +github.com/valyala/fasthttp v1.71.0/go.mod h1:z1sDUvOShhXq/C9mwH/fSm1Vb71tUJwmQdgkBrBNwnA= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo= github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= @@ -78,6 +71,8 @@ github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHo github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ= github.com/xeipuuv/gojsonschema v1.2.0 h1:LhYJRs+L4fBtjZUfuSZIKGeVu0QRy8e5Xi7D17UxZ74= github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQluxsYJ78Id3Y= +github.com/xyproto/randomstring v1.0.5 h1:YtlWPoRdgMu3NZtP45drfy1GKoojuR7hmRcnhZqKjWU= +github.com/xyproto/randomstring v1.0.5/go.mod h1:rgmS5DeNXLivK7YprL0pY+lTuhNQW3iGxZ18UQApw/E= github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 h1:6fRhSjgLCkTD3JnJxvaJ4Sj+TYblw757bqYgZaOq5ZY= github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0/go.mod h1:/LWChgwKmvncFJFHJ7Gvn9wZArjbV5/FppcK2fKk/tI= github.com/yudai/gojsondiff v1.0.0 h1:27cbfqXLVEJ1o8I6v3y9lg8Ydm53EKqHXAOMxEGlCOA= @@ -90,20 +85,14 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= -golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I= -golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4= +golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= +golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -111,29 +100,17 @@ golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA= -golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= +golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= +golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20201211185031-d93e913c1a58/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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= @@ -145,8 +122,7 @@ gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= -gopkg.in/yaml.v3 v3.0.0 h1:hjy8E9ON/egN1tAYqKb61G10WtihqetD4sz2H+8nIeA= -gopkg.in/yaml.v3 v3.0.0/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= moul.io/http2curl/v2 v2.3.0 h1:9r3JfDzWPcbIklMOs2TnIFzDYvfAZvjeavG6EzP7jYs= moul.io/http2curl/v2 v2.3.0/go.mod h1:RW4hyBjTWSYDOxapodpNEtX0g5Eb16sxklBqmd2RHcE= From 7fa788617c7c562f3f26cbb734d59a7913a26d39 Mon Sep 17 00:00:00 2001 From: Augustin Husson Date: Fri, 5 Jun 2026 11:35:58 +0200 Subject: [PATCH 2/4] update workflows Signed-off-by: Augustin Husson --- .github/workflows/build.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e4e2fae1e..a2a292ad0 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -18,7 +18,7 @@ jobs: build: strategy: matrix: - go: [1.19, 1.x] + go: [1.25, 1.x] os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} @@ -28,7 +28,7 @@ jobs: uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v5.3.0 + uses: actions/setup-go@v6 with: go-version: ${{ matrix.go }} cache: true @@ -51,7 +51,7 @@ jobs: uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v5.3.0 + uses: actions/setup-go@v6 with: go-version: 1.x cache: true @@ -71,7 +71,7 @@ jobs: uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v5.3.0 + uses: actions/setup-go@v6 with: go-version: 1.x @@ -110,16 +110,16 @@ jobs: uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v5.3.0 + uses: actions/setup-go@v6 with: go-version: 1.x cache: false - name: Run linters - uses: golangci/golangci-lint-action@v6.5.0 + uses: golangci/golangci-lint-action@v9.2.1 timeout-minutes: 20 with: - version: v1.63.4 + version: v2.12.1 working-directory: ${{ matrix.dir }} args: --timeout=20m @@ -133,7 +133,7 @@ jobs: uses: actions/checkout@v4 - name: Install Go - uses: actions/setup-go@v5.3.0 + uses: actions/setup-go@v6 with: go-version: 1.x cache: true From 31d3a583f86ef37e2811a80c611b77c817b3c37b Mon Sep 17 00:00:00 2001 From: Augustin Husson Date: Fri, 5 Jun 2026 11:40:02 +0200 Subject: [PATCH 3/4] update golangci config Signed-off-by: Augustin Husson --- .golangci.yml | 31 ++++++++++++------------------- _examples/.golangci.yml | 20 ++++++++------------ 2 files changed, 20 insertions(+), 31 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index fb875e737..ce7ad453a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,16 @@ +version: "2" linters: + settings: + lll: + line-length: 90 + revive: + rules: + - name: unused-parameter + disabled: true + - name: error-strings + disabled: true + - name: indent-error-flow + disabled: true enable: - govet - revive @@ -7,22 +19,3 @@ linters: - lll - misspell - dupword - disable: - - gosimple - - unused - -linters-settings: - lll: - line-length: 90 - -issues: - exclude-rules: - - text: unused-parameter - linters: - - revive - - text: error-strings - linters: - - revive - - text: indent-error-flow - linters: - - revive diff --git a/_examples/.golangci.yml b/_examples/.golangci.yml index 331025504..d5c0c6296 100644 --- a/_examples/.golangci.yml +++ b/_examples/.golangci.yml @@ -1,4 +1,12 @@ +version: "2" linters: + settings: + lll: + line-length: 90 + revive: + rules: + - name: unused-parameter + disabled: true enable: - govet - revive @@ -7,16 +15,4 @@ linters: - misspell - dupword disable: - - gosimple - - unused - errcheck - -linters-settings: - lll: - line-length: 90 - -issues: - exclude-rules: - - text: unused-parameter - linters: - - revive From f8f128b69f5e083b479412bf5e07f44ff522d304 Mon Sep 17 00:00:00 2001 From: Augustin Husson Date: Fri, 5 Jun 2026 12:21:09 +0200 Subject: [PATCH 4/4] fix linter issues Signed-off-by: Augustin Husson --- _examples/go.mod | 32 ++++++++++++------------- _examples/go.sum | 56 +++++++++++++++++++++---------------------- array.go | 4 ++-- binder.go | 3 ++- binder_test.go | 7 +++--- boolean.go | 6 ++--- datetime.go | 8 +++---- duration.go | 14 +++++------ e2e/chunked_test.go | 3 ++- e2e/context_test.go | 2 +- e2e/fs_test.go | 2 +- e2e/mocks_test.go | 2 +- e2e/printer_test.go | 4 ++-- e2e/websocket_test.go | 4 ++-- formatter.go | 28 ++++++++++------------ match.go | 4 ++-- mocks_test.go | 15 ++++++------ number.go | 22 ++++++++--------- object.go | 4 ++-- object_test.go | 1 - printer.go | 26 ++++++++++---------- reporter_test.go | 4 ++-- request.go | 27 ++++++++++----------- request_test.go | 4 ++-- response.go | 2 +- string.go | 4 ++-- value.go | 2 +- value_test.go | 10 ++++---- websocket_test.go | 2 +- 29 files changed, 146 insertions(+), 156 deletions(-) diff --git a/_examples/go.mod b/_examples/go.mod index 1d5c1e890..3f20c2eb7 100644 --- a/_examples/go.mod +++ b/_examples/go.mod @@ -1,8 +1,6 @@ module examples -go 1.23.0 - -toolchain go1.23.4 +go 1.25.0 require ( github.com/dgrijalva/jwt-go v3.2.0+incompatible @@ -14,7 +12,7 @@ require ( github.com/kataras/iris/v12 v12.2.11 github.com/labstack/echo-jwt/v4 v4.3.0 github.com/labstack/echo/v4 v4.13.3 - github.com/valyala/fasthttp v1.59.0 + github.com/valyala/fasthttp v1.71.0 golang.org/x/oauth2 v0.4.0 google.golang.org/appengine v1.6.8 ) @@ -26,14 +24,14 @@ require ( github.com/Joker/jade v1.1.3 // indirect github.com/Shopify/goreferrer v0.0.0-20240724165105-aceaa0259138 // indirect github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2 // indirect - github.com/ajg/form v1.5.1 // indirect - github.com/andybalholm/brotli v1.1.1 // indirect + github.com/ajg/form v1.7.1 // indirect + github.com/andybalholm/brotli v1.2.1 // indirect github.com/aymerick/douceur v0.2.0 // indirect github.com/bytedance/sonic v1.12.10 // indirect github.com/bytedance/sonic/loader v0.2.3 // indirect github.com/cloudwego/base64x v0.1.5 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fatih/color v1.18.0 // indirect + github.com/fatih/color v1.19.0 // indirect github.com/fatih/structs v1.1.0 // indirect github.com/flosch/pongo2/v4 v4.0.2 // indirect github.com/gabriel-vasile/mimetype v1.4.8 // indirect @@ -48,7 +46,7 @@ require ( github.com/golang/protobuf v1.5.4 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/gomarkdown/markdown v0.0.0-20250207164621-7a1f277a159e // indirect - github.com/google/go-querystring v1.1.0 // indirect + github.com/google/go-querystring v1.2.0 // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/css v1.0.1 // indirect github.com/imkira/go-interpol v1.1.0 // indirect @@ -60,14 +58,14 @@ require ( github.com/kataras/pio v0.0.13 // indirect github.com/kataras/sitemap v0.0.6 // indirect github.com/kataras/tunnel v0.0.4 // indirect - github.com/klauspost/compress v1.18.0 // indirect + github.com/klauspost/compress v1.18.6 // indirect github.com/klauspost/cpuid/v2 v2.2.10 // indirect github.com/labstack/gommon v0.4.2 // indirect github.com/leodido/go-urn v1.4.0 // indirect github.com/mailgun/raymond/v2 v2.0.48 // indirect github.com/mailru/easyjson v0.9.0 // indirect - github.com/mattn/go-colorable v0.1.14 // indirect - github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mattn/go-colorable v0.1.15 // indirect + github.com/mattn/go-isatty v0.0.22 // indirect github.com/microcosm-cc/bluemonday v1.0.27 // indirect github.com/mitchellh/go-wordwrap v1.0.1 // indirect github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect @@ -78,10 +76,10 @@ require ( github.com/sanity-io/litter v1.5.8 // indirect github.com/savsgio/gotils v0.0.0-20240704082632-aef3928b8a38 // indirect github.com/schollz/closestmatch v2.1.0+incompatible // indirect - github.com/sergi/go-diff v1.3.1 // indirect + github.com/sergi/go-diff v1.4.0 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/smartystreets/goconvey v1.7.2 // indirect - github.com/stretchr/testify v1.10.0 // indirect + github.com/stretchr/testify v1.11.1 // indirect github.com/tdewolff/minify/v2 v2.21.3 // indirect github.com/tdewolff/parse/v2 v2.7.20 // indirect github.com/tidwall/btree v1.7.0 // indirect @@ -106,11 +104,11 @@ require ( github.com/yudai/gojsondiff v1.0.0 // indirect github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect golang.org/x/arch v0.14.0 // indirect - golang.org/x/crypto v0.36.0 // indirect + golang.org/x/crypto v0.51.0 // indirect golang.org/x/exp v0.0.0-20250228200357-dead58393ab7 // indirect - golang.org/x/net v0.38.0 // indirect - golang.org/x/sys v0.31.0 // indirect - golang.org/x/text v0.23.0 // indirect + golang.org/x/net v0.55.0 // indirect + golang.org/x/sys v0.45.0 // indirect + golang.org/x/text v0.37.0 // indirect golang.org/x/time v0.10.0 // indirect google.golang.org/protobuf v1.36.5 // indirect gopkg.in/ini.v1 v1.67.0 // indirect diff --git a/_examples/go.sum b/_examples/go.sum index f2f3e967c..0c8584bed 100644 --- a/_examples/go.sum +++ b/_examples/go.sum @@ -13,11 +13,12 @@ github.com/Shopify/goreferrer v0.0.0-20240724165105-aceaa0259138 h1:gjbp60h8IZQb github.com/Shopify/goreferrer v0.0.0-20240724165105-aceaa0259138/go.mod h1:NYezi6wtnJtBm5btoprXc5SvAdqH0XTXWnUup0MptAI= github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2 h1:ZBbLwSJqkHBuFDA6DUhhse0IGJ7T5bemHyNILUjvOq4= github.com/TylerBrock/colorjson v0.0.0-20200706003622-8a50f05110d2/go.mod h1:VSw57q4QFiWDbRnjdX8Cb3Ow0SFncRw+bA/ofY6Q83w= -github.com/ajg/form v1.5.1 h1:t9c7v8JUKu/XxOGBU0yjNpaMloxGEJhUkqFRq0ibGeU= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= +github.com/ajg/form v1.7.1 h1:OsnBDzTkrWdrxvEnO68I72ZVGJGNaMwPhoAm0V+llgc= +github.com/ajg/form v1.7.1/go.mod h1:HL757PzLyNkj5AIfptT6L+iGNeXTlnrr/oDePGc/y7Q= github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= -github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7XdTA= -github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA= +github.com/andybalholm/brotli v1.2.1 h1:R+f5xP285VArJDRgowrfb9DqL18yVK0gKAW/F+eTWro= +github.com/andybalholm/brotli v1.2.1/go.mod h1:rzTDkvFWvIrjDXZHkuS16NPggd91W3kUSvPlQ1pLaKY= github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/bytedance/sonic v1.12.10 h1:uVCQr6oS5669E9ZVW0HyksTLfNS7Q/9hV6IVS4nEMsI= @@ -37,8 +38,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/fasthttp-contrib/websocket v0.0.0-20160511215533-1f3b11f56072/go.mod h1:duJ4Jxv5lDcvg4QuQr0oowTf7dz4/CR8NtyCooz9HL8= github.com/fasthttp/websocket v1.5.12 h1:e4RGPpWW2HTbL3zV0Y/t7g0ub294LkiuXXUuTOUInlE= github.com/fasthttp/websocket v1.5.12/go.mod h1:I+liyL7/4moHojiOgUOIKEWm9EIxHqxZChS+aMFltyg= -github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= -github.com/fatih/color v1.18.0/go.mod h1:4FelSpRwEGDpQ12mAdzqdOukCy4u8WUtOY6lkT/6HfU= +github.com/fatih/color v1.19.0 h1:Zp3PiM21/9Ld6FzSKyL5c/BULoe/ONr9KlbYVOfG8+w= +github.com/fatih/color v1.19.0/go.mod h1:zNk67I0ZUT1bEGsSGyCZYZNrHuTkJJB+r6Q9VuMi0LE= github.com/fatih/structs v1.1.0 h1:Q7juDM0QtcnhCpeyLGQKyg4TOIghuNXrkL32pHAUMxo= github.com/fatih/structs v1.1.0/go.mod h1:9NiDSp5zOcgEDl+j00MP/WkGVPOlPRLejGD8Ga6PJ7M= github.com/flosch/pongo2/v4 v4.0.2 h1:gv+5Pe3vaSVmiJvh/BZa82b7/00YUGm0PIyVVLop0Hw= @@ -96,13 +97,12 @@ github.com/gomarkdown/markdown v0.0.0-20250207164621-7a1f277a159e/go.mod h1:JDGc github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= -github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= +github.com/google/go-querystring v1.2.0 h1:yhqkPbu2/OH+V9BfpCVPZkNmUXhb2gBxJArfhIxNtP0= +github.com/google/go-querystring v1.2.0/go.mod h1:8IFJqpSRITyJ8QhQ13bmbeMBDfmeEJZD5A0egEOmkqU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -143,8 +143,8 @@ github.com/kataras/sitemap v0.0.6/go.mod h1:dW4dOCNs896OR1HmG+dMLdT7JjDk7mYBzoIR github.com/kataras/tunnel v0.0.4 h1:sCAqWuJV7nPzGrlb0os3j49lk2JhILT0rID38NHNLpA= github.com/kataras/tunnel v0.0.4/go.mod h1:9FkU4LaeifdMWqZu7o20ojmW4B7hdhv2CMLwfnHGpYw= github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= -github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= +github.com/klauspost/compress v1.18.6 h1:2jupLlAwFm95+YDR+NwD2MEfFO9d4z4Prjl1XXDjuao= +github.com/klauspost/compress v1.18.6/go.mod h1:cwPg85FWrGar70rWktvGQj8/hthj3wpl0PGDogxkrSQ= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= @@ -166,11 +166,11 @@ github.com/mailgun/raymond/v2 v2.0.48/go.mod h1:lsgvL50kgt1ylcFJYZiULi5fjPBkkhNf github.com/mailru/easyjson v0.9.0 h1:PrnmzHw7262yW8sTBwxi1PdJA3Iw/EKBa8psRf7d9a4= github.com/mailru/easyjson v0.9.0/go.mod h1:1+xMtQp2MRNVL/V1bOzuP3aP8VNwRW55fQUto+XFtTU= github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= -github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= +github.com/mattn/go-colorable v0.1.15 h1:+u9SLTRGnXv73cEsnsmoZBom+dMU88B2M0aDcWy0/jY= +github.com/mattn/go-colorable v0.1.15/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= -github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.22 h1:j8l17JJ9i6VGPUFUYoTUKPSgKe/83EYU2zBC7YNKMw4= +github.com/mattn/go-isatty v0.0.22/go.mod h1:ZXfXG4SQHsB/w3ZeOYbR0PrPwLy+n6xiMrJlRFqopa4= github.com/microcosm-cc/bluemonday v1.0.27 h1:MpEUotklkwCSLeH+Qdx1VJgNqLlpY2KXwXFM08ygZfk= github.com/microcosm-cc/bluemonday v1.0.27/go.mod h1:jFi9vgW+H7c3V0lb6nR74Ib/DIB5OBs92Dimizgw2cA= github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= @@ -211,8 +211,8 @@ github.com/schollz/closestmatch v2.1.0+incompatible/go.mod h1:RtP1ddjLong6gTkbtm github.com/sclevine/agouti v3.0.0+incompatible/go.mod h1:b4WX9W9L1sfQKXeJf1mUTLZKJ48R1S7H23Ji7oFO5Bw= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sergi/go-diff v1.3.1 h1:xkr+Oxo4BOQKmkn/B9eMK0g5Kg/983T9DqqPHwYqD+8= -github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= +github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw= +github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= @@ -236,8 +236,9 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/tailscale/depaware v0.0.0-20210622194025-720c4b409502/go.mod h1:p9lPsd+cx33L3H9nNoecRRxPssFKUwwI50I3pZ0yT+8= github.com/tdewolff/minify/v2 v2.21.3 h1:KmhKNGrN/dGcvb2WDdB5yA49bo37s+hcD8RiF+lioV8= github.com/tdewolff/minify/v2 v2.21.3/go.mod h1:iGxHaGiONAnsYuo8CRyf8iPUcqRJVB/RhtEcTpqS7xw= @@ -283,8 +284,8 @@ github.com/ugorji/go/codec v1.2.12/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZ github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.34.0/go.mod h1:epZA5N+7pY6ZaEKRmstzOuYJx9HI8DI1oaCGZpdH4h0= -github.com/valyala/fasthttp v1.59.0 h1:Qu0qYHfXvPk1mSLNqcFtEk6DpxgA26hy6bmydotDpRI= -github.com/valyala/fasthttp v1.59.0/go.mod h1:GTxNb9Bc6r2a9D0TWNSPwDz78UxnTGBViY3xZNEqyYU= +github.com/valyala/fasthttp v1.71.0 h1:tepR7H+Guh9VUqxxcPggYi8R3lGUu2Rsdh+z7/FCY3k= +github.com/valyala/fasthttp v1.71.0/go.mod h1:z1sDUvOShhXq/C9mwH/fSm1Vb71tUJwmQdgkBrBNwnA= github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= @@ -321,8 +322,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.36.0 h1:AnAEvhDddvBdpY+uR+MyHmuZzzNqXSe/GvuDeob5L34= -golang.org/x/crypto v0.36.0/go.mod h1:Y4J0ReaxCR1IMaabaSMugxJES1EpwhBHhv2bDHklZvc= +golang.org/x/crypto v0.51.0 h1:IBPXwPfKxY7cWQZ38ZCIRPI50YLeevDLlLnyC5wRGTI= +golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8= golang.org/x/exp v0.0.0-20250228200357-dead58393ab7 h1:aWwlzYV971S4BXRS9AmqwDLAD85ouC6X+pocatKY58c= golang.org/x/exp v0.0.0-20250228200357-dead58393ab7/go.mod h1:BHOTPb3L19zxehTsLoJXVaTktb06DFgmdW6Wb9s8jqk= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -344,8 +345,8 @@ golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.38.0 h1:vRMAPTMaeGqVhG5QyLJHqNDwecKTomGeqbnfZyKlBI8= -golang.org/x/net v0.38.0/go.mod h1:ivrbrMbzFq5J41QOQh0siUuly180yBYtLp+CKbEaFx8= +golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= +golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.4.0 h1:NF0gk8LVPg1Ml7SSbGyySuoxdsXitj7TvgvuRxIMc/M= golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec= @@ -376,9 +377,8 @@ golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.31.0 h1:ioabZlmFYtWhL+TRYpcnNlLwhyxaM9kWTDEmfnprqik= -golang.org/x/sys v0.31.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= +golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -387,8 +387,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.23.0 h1:D71I7dUrlY+VX0gQShAThNGHFxZ13dGLBHQLVl1mJlY= -golang.org/x/text v0.23.0/go.mod h1:/BLNzu4aZCJ1+kcD0DNRotWKage4q2rGVAg4o22unh4= +golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= +golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= golang.org/x/time v0.10.0 h1:3usCWA8tQn0L8+hFJQNgzpWbd89begxN66o1Ojdn5L4= golang.org/x/time v0.10.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/array.go b/array.go index c1314d2f9..a02d01c54 100644 --- a/array.go +++ b/array.go @@ -715,7 +715,7 @@ func (a *Array) IsEmpty() *Array { return a } - if !(len(a.value) == 0) { + if len(a.value) > 0 { opChain.fail(AssertionFailure{ Type: AssertEmpty, Actual: &AssertionValue{a.value}, @@ -1240,7 +1240,7 @@ func (a *Array) NotContains(values ...interface{}) *Array { } for _, expected := range elements { - if !(countElement(a.value, expected) == 0) { + if countElement(a.value, expected) > 0 { opChain.fail(AssertionFailure{ Type: AssertNotContainsElement, Actual: &AssertionValue{a.value}, diff --git a/binder.go b/binder.go index f1b3d1719..1a701b1eb 100644 --- a/binder.go +++ b/binder.go @@ -202,13 +202,14 @@ func fast2std(stdreq *http.Request, fastresp *fasthttp.Response) *http.Response Request: stdreq, } - fastresp.Header.VisitAll(func(k, v []byte) { + fastresp.Header.All()(func(k, v []byte) bool { sk := string(k) sv := string(v) if stdresp.Header == nil { stdresp.Header = make(http.Header) } stdresp.Header.Add(sk, sv) + return true }) if fastresp.Header.ContentLength() >= 0 { diff --git a/binder_test.go b/binder_test.go index e5729b5ac..e27fc2b3a 100644 --- a/binder_test.go +++ b/binder_test.go @@ -195,9 +195,9 @@ func TestFastBinder_Basic(t *testing.T) { assert.Nil(t, ctx.TLSConnectionState()) headers := map[string][]string{} - - ctx.Request.Header.VisitAll(func(k, v []byte) { + ctx.Request.Header.All()(func(k, v []byte) bool { headers[string(k)] = append(headers[string(k)], string(v)) + return true }) expected := map[string][]string{ @@ -411,8 +411,9 @@ func TestFastBinder_Chunked(t *testing.T) { headers := map[string][]string{} - ctx.Request.Header.VisitAll(func(k, v []byte) { + ctx.Request.Header.All()(func(k, v []byte) bool { headers[string(k)] = append(headers[string(k)], string(v)) + return true }) expected := map[string][]string{ diff --git a/boolean.go b/boolean.go index b2d0412dd..ce4c3d511 100644 --- a/boolean.go +++ b/boolean.go @@ -117,7 +117,7 @@ func (b *Boolean) IsTrue() *Boolean { return b } - if !(b.value == true) { + if !b.value { opChain.fail(AssertionFailure{ Type: AssertEqual, Actual: &AssertionValue{b.value}, @@ -145,7 +145,7 @@ func (b *Boolean) IsFalse() *Boolean { return b } - if !(b.value == false) { + if b.value { opChain.fail(AssertionFailure{ Type: AssertEqual, Actual: &AssertionValue{b.value}, @@ -183,7 +183,7 @@ func (b *Boolean) IsEqual(value bool) *Boolean { return b } - if !(b.value == value) { + if b.value != value { opChain.fail(AssertionFailure{ Type: AssertEqual, Actual: &AssertionValue{b.value}, diff --git a/datetime.go b/datetime.go index d23394442..fdeb98203 100644 --- a/datetime.go +++ b/datetime.go @@ -377,8 +377,8 @@ func (dt *DateTime) InRange(min, max time.Time) *DateTime { return dt } - if !((dt.value.After(min) || dt.value.Equal(min)) && - (dt.value.Before(max) || dt.value.Equal(max))) { + if !((dt.value.After(min) || dt.value.Equal(min)) && //nolint:staticcheck + (dt.value.Before(max) || dt.value.Equal(max))) { //nolint:staticcheck opChain.fail(AssertionFailure{ Type: AssertInRange, Actual: &AssertionValue{dt.value}, @@ -564,7 +564,7 @@ func (dt *DateTime) IsGe(value time.Time) *DateTime { return dt } - if !(dt.value.After(value) || dt.value.Equal(value)) { + if !dt.value.After(value) && !dt.value.Equal(value) { opChain.fail(AssertionFailure{ Type: AssertGe, Actual: &AssertionValue{dt.value}, @@ -620,7 +620,7 @@ func (dt *DateTime) IsLe(value time.Time) *DateTime { return dt } - if !(dt.value.Before(value) || dt.value.Equal(value)) { + if !dt.value.Before(value) && !dt.value.Equal(value) { opChain.fail(AssertionFailure{ Type: AssertLe, Actual: &AssertionValue{dt.value}, diff --git a/duration.go b/duration.go index abeaec16e..94541fbb9 100644 --- a/duration.go +++ b/duration.go @@ -98,7 +98,7 @@ func (d *Duration) NotSet() *Duration { return d } - if !(d.value == nil) { + if d.value != nil { opChain.fail(AssertionFailure{ Type: AssertNotNil, Actual: &AssertionValue{d.value}, @@ -136,7 +136,7 @@ func (d *Duration) IsEqual(value time.Duration) *Duration { return d } - if !(*d.value == value) { + if *d.value != value { opChain.fail(AssertionFailure{ Type: AssertEqual, Actual: &AssertionValue{d.value}, @@ -219,7 +219,7 @@ func (d *Duration) IsGt(value time.Duration) *Duration { return d } - if !(*d.value > value) { + if *d.value <= value { opChain.fail(AssertionFailure{ Type: AssertGt, Actual: &AssertionValue{d.value}, @@ -258,7 +258,7 @@ func (d *Duration) IsGe(value time.Duration) *Duration { return d } - if !(*d.value >= value) { + if *d.value < value { opChain.fail(AssertionFailure{ Type: AssertGe, Actual: &AssertionValue{d.value}, @@ -297,7 +297,7 @@ func (d *Duration) IsLt(value time.Duration) *Duration { return d } - if !(*d.value < value) { + if *d.value >= value { opChain.fail(AssertionFailure{ Type: AssertLt, Actual: &AssertionValue{d.value}, @@ -336,7 +336,7 @@ func (d *Duration) IsLe(value time.Duration) *Duration { return d } - if !(*d.value <= value) { + if *d.value > value { opChain.fail(AssertionFailure{ Type: AssertLe, Actual: &AssertionValue{d.value}, @@ -396,7 +396,7 @@ func (d *Duration) InRange(min, max time.Duration) *Duration { return d } - if !(*d.value >= min && *d.value <= max) { + if *d.value < min || *d.value > max { opChain.fail(AssertionFailure{ Type: AssertInRange, Actual: &AssertionValue{d.value}, diff --git a/e2e/chunked_test.go b/e2e/chunked_test.go index 41142be72..637d1781c 100644 --- a/e2e/chunked_test.go +++ b/e2e/chunked_test.go @@ -39,8 +39,9 @@ func createChunkedFastHandler(t *testing.T) fasthttp.RequestHandler { return func(ctx *fasthttp.RequestCtx) { headers := map[string][]string{} - ctx.Request.Header.VisitAll(func(k, v []byte) { + ctx.Request.Header.All()(func(k, v []byte) bool { headers[string(k)] = append(headers[string(k)], string(v)) + return true }) assert.Equal(t, []string{"chunked"}, headers["Transfer-Encoding"]) diff --git a/e2e/context_test.go b/e2e/context_test.go index 26af3ea1f..bd6117fbb 100644 --- a/e2e/context_test.go +++ b/e2e/context_test.go @@ -109,7 +109,7 @@ func newErrorSuppressor( } } -func (h *errorSuppressor) Success(ctx *httpexpect.AssertionContext) { +func (h *errorSuppressor) Success(_ *httpexpect.AssertionContext) { } func (h *errorSuppressor) Failure( diff --git a/e2e/fs_test.go b/e2e/fs_test.go index b4d25498e..c9adc7ed4 100644 --- a/e2e/fs_test.go +++ b/e2e/fs_test.go @@ -15,7 +15,7 @@ func TestE2EFs_FastBinder(t *testing.T) { if err != nil { t.Fatal(err) } - defer os.RemoveAll(tempdir) + defer os.RemoveAll(tempdir) // nolint:errcheck if err := os.WriteFile( path.Join(tempdir, "hello"), []byte("hello, world!"), 0666); err != nil { diff --git a/e2e/mocks_test.go b/e2e/mocks_test.go index dd8cbf9ae..af757aab3 100644 --- a/e2e/mocks_test.go +++ b/e2e/mocks_test.go @@ -5,6 +5,6 @@ type mockReporter struct { } // Errorf implements Reporter.Errorf. -func (r *mockReporter) Errorf(message string, args ...interface{}) { +func (r *mockReporter) Errorf(_ string, _ ...interface{}) { r.failed = true } diff --git a/e2e/printer_test.go b/e2e/printer_test.go index 72d0cd9fc..d595848f0 100644 --- a/e2e/printer_test.go +++ b/e2e/printer_test.go @@ -20,14 +20,14 @@ type mockPrinter struct { func (p *mockPrinter) Request(req *http.Request) { if req.Body != nil { p.reqBody, _ = io.ReadAll(req.Body) - req.Body.Close() + req.Body.Close() // nolint:errcheck } } func (p *mockPrinter) Response(resp *http.Response, rtt time.Duration) { if resp.Body != nil { p.respBody, _ = io.ReadAll(resp.Body) - resp.Body.Close() + resp.Body.Close() // nolint:errcheck } p.rtt = rtt } diff --git a/e2e/websocket_test.go b/e2e/websocket_test.go index 7eecdf05c..4517043d9 100644 --- a/e2e/websocket_test.go +++ b/e2e/websocket_test.go @@ -34,7 +34,7 @@ func createWebsocketHandler(opts wsHandlerOpts) http.Handler { if err != nil { panic(err) } - defer c.Close() + defer c.Close() // nolint:errcheck for { if opts.preRead != nil { @@ -63,7 +63,7 @@ func websocketFastHandler(ctx *fasthttp.RequestCtx) { ctx.Response.Header.Set("X-Test", "test_header") err := upgrader.Upgrade(ctx, func(c *fastwebsocket.Conn) { - defer c.Close() + defer c.Close() // nolint:errcheck for { mt, message, err := c.ReadMessage() diff --git a/formatter.go b/formatter.go index 02985f31c..933fd0c10 100644 --- a/formatter.go +++ b/formatter.go @@ -354,7 +354,7 @@ func (f *DefaultFormatter) fillGeneral( } func (f *DefaultFormatter) fillErrors( - data *FormatData, ctx *AssertionContext, failure *AssertionFailure, + data *FormatData, _ *AssertionContext, failure *AssertionFailure, ) { data.Errors = []string{} @@ -367,7 +367,7 @@ func (f *DefaultFormatter) fillErrors( } func (f *DefaultFormatter) fillActual( - data *FormatData, ctx *AssertionContext, failure *AssertionFailure, + data *FormatData, _ *AssertionContext, failure *AssertionFailure, ) { switch failure.Type { //nolint case AssertUsage, AssertOperation: @@ -384,7 +384,7 @@ func (f *DefaultFormatter) fillActual( } func (f *DefaultFormatter) fillExpected( - data *FormatData, ctx *AssertionContext, failure *AssertionFailure, + data *FormatData, _ *AssertionContext, failure *AssertionFailure, ) { switch failure.Type { case AssertUsage, AssertOperation, @@ -478,7 +478,7 @@ func (f *DefaultFormatter) fillExpected( } func (f *DefaultFormatter) fillIsNegation( - data *FormatData, ctx *AssertionContext, failure *AssertionFailure, + data *FormatData, _ *AssertionContext, failure *AssertionFailure, ) { switch failure.Type { case AssertUsage, AssertOperation, @@ -518,7 +518,7 @@ func (f *DefaultFormatter) fillIsNegation( } func (f *DefaultFormatter) fillIsComparison( - data *FormatData, ctx *AssertionContext, failure *AssertionFailure, + data *FormatData, _ *AssertionContext, failure *AssertionFailure, ) { switch failure.Type { //nolint case AssertLt, AssertLe, AssertGt, AssertGe: @@ -527,21 +527,21 @@ func (f *DefaultFormatter) fillIsComparison( } func (f *DefaultFormatter) fillReference( - data *FormatData, ctx *AssertionContext, failure *AssertionFailure, + data *FormatData, _ *AssertionContext, failure *AssertionFailure, ) { data.HaveReference = true data.Reference = f.formatValue(failure.Reference.Value) } func (f *DefaultFormatter) fillDelta( - data *FormatData, ctx *AssertionContext, failure *AssertionFailure, + data *FormatData, _ *AssertionContext, failure *AssertionFailure, ) { data.HaveDelta = true data.Delta = f.formatValue(failure.Delta.Value) } func (f *DefaultFormatter) fillRequest( - data *FormatData, ctx *AssertionContext, failure *AssertionFailure, + data *FormatData, ctx *AssertionContext, _ *AssertionFailure, ) { if !f.DisableRequests && ctx.Request != nil && ctx.Request.httpReq != nil { dump, err := httputil.DumpRequest(ctx.Request.httpReq, false) @@ -555,7 +555,7 @@ func (f *DefaultFormatter) fillRequest( } func (f *DefaultFormatter) fillResponse( - data *FormatData, ctx *AssertionContext, failure *AssertionFailure, + data *FormatData, ctx *AssertionContext, _ *AssertionFailure, ) { if !f.DisableResponses && ctx.Response != nil && ctx.Response.httpResp != nil { dump, err := httputil.DumpResponse(ctx.Response.httpResp, false) @@ -563,7 +563,7 @@ func (f *DefaultFormatter) fillResponse( return } - text := strings.Replace(string(dump), "\r\n", "\n", -1) + text := strings.Replace(string(dump), "\r\n", "\n", -1) // nolint:staticcheck lines := strings.SplitN(text, "\n", 2) data.HaveResponse = true @@ -572,7 +572,7 @@ func (f *DefaultFormatter) fillResponse( } func (f *DefaultFormatter) fillStacktrace( - data *FormatData, ctx *AssertionContext, failure *AssertionFailure, + data *FormatData, _ *AssertionContext, failure *AssertionFailure, ) { data.Stacktrace = []string{} @@ -796,13 +796,10 @@ func (f *DefaultFormatter) applySeparator(numStr string, dir int) string { switch f.DigitSeparator { case DigitSeparatorUnderscore: separator = "_" - break case DigitSeparatorApostrophe: separator = "'" - break case DigitSeparatorComma: separator = "," - break case DigitSeparatorNone: default: return numStr @@ -905,7 +902,6 @@ func colorMode() int { } colorsSupportedMode = colorsUnsupported - return }) return colorsSupportedMode @@ -1031,7 +1027,7 @@ var defaultTemplateFuncs = template.FuncMap{ var words []string if isFirstLine { - words = strings.SplitN(line, " ", -1) + words = strings.SplitN(line, " ", -1) // nolint:staticcheck } else { words = strings.SplitN(line, " ", 2) } diff --git a/match.go b/match.go index 575d57ee7..c01a1edc8 100644 --- a/match.go +++ b/match.go @@ -215,7 +215,7 @@ func (m *Match) IsEmpty() *Match { return m } - if !(len(m.submatchValues) == 0) { + if len(m.submatchValues) != 0 { opChain.fail(AssertionFailure{ Type: AssertEmpty, Actual: &AssertionValue{m.submatchValues}, @@ -242,7 +242,7 @@ func (m *Match) NotEmpty() *Match { return m } - if !(len(m.submatchValues) != 0) { + if len(m.submatchValues) == 0 { opChain.fail(AssertionFailure{ Type: AssertNotEmpty, Actual: &AssertionValue{m.submatchValues}, diff --git a/mocks_test.go b/mocks_test.go index c2a3e6c75..b7f4541d6 100644 --- a/mocks_test.go +++ b/mocks_test.go @@ -78,7 +78,7 @@ func (mf *mockFormatter) FormatSuccess(ctx *AssertionContext) string { } func (mf *mockFormatter) FormatFailure( - ctx *AssertionContext, failure *AssertionFailure, + ctx *AssertionContext, _ *AssertionFailure, ) string { mf.formattedFailure++ return ctx.TestName @@ -126,11 +126,11 @@ func (mp *mockWebsocketPrinter) Request(*http.Request) { func (mp *mockWebsocketPrinter) Response(*http.Response, time.Duration) { } -func (mp *mockWebsocketPrinter) WebsocketWrite(typ int, content []byte, closeCode int) { +func (mp *mockWebsocketPrinter) WebsocketWrite(_ int, _ []byte, _ int) { mp.isWrittenTo = true } -func (mp *mockWebsocketPrinter) WebsocketRead(typ int, content []byte, closeCode int) { +func (mp *mockWebsocketPrinter) WebsocketRead(_ int, _ []byte, _ int) { mp.isReadFrom = true } @@ -143,7 +143,6 @@ type mockWebsocketConn struct { readDlError error writeDlError error msgType int - msg []byte } func (mc *mockWebsocketConn) Subprotocol() string { @@ -154,11 +153,11 @@ func (mc *mockWebsocketConn) Close() error { return mc.closeError } -func (mc *mockWebsocketConn) SetReadDeadline(t time.Time) error { +func (mc *mockWebsocketConn) SetReadDeadline(_ time.Time) error { return mc.readDlError } -func (mc *mockWebsocketConn) SetWriteDeadline(t time.Time) error { +func (mc *mockWebsocketConn) SetWriteDeadline(_ time.Time) error { return mc.writeDlError } @@ -166,7 +165,7 @@ func (mc *mockWebsocketConn) ReadMessage() (messageType int, p []byte, err error return mc.msgType, []byte{}, mc.readMsgErr } -func (mc *mockWebsocketConn) WriteMessage(messageType int, data []byte) error { +func (mc *mockWebsocketConn) WriteMessage(_ int, _ []byte) error { return mc.writeMsgErr } @@ -356,6 +355,6 @@ func (me *mockError) Error() string { } // mock sleep function -func mockSleep(time.Duration) <-chan time.Time { +func mockSleep(_ time.Duration) <-chan time.Time { return time.After(0) } diff --git a/number.go b/number.go index a71c78bfd..6907494a1 100644 --- a/number.go +++ b/number.go @@ -127,7 +127,7 @@ func (n *Number) IsEqual(value interface{}) *Number { return n } - if !(n.value == num) { + if n.value != num { opChain.fail(AssertionFailure{ Type: AssertEqual, Actual: &AssertionValue{n.value}, @@ -277,7 +277,7 @@ func (n *Number) NotInDelta(value, delta float64) *Number { diff := n.value - value - if !(diff < -delta || diff > delta) { + if diff >= -delta && diff <= delta { opChain.fail(AssertionFailure{ Type: AssertNotEqual, Actual: &AssertionValue{n.value}, @@ -562,7 +562,7 @@ func (n *Number) InRange(min, max interface{}) *Number { return n } - if !(n.value >= a && n.value <= b) { + if n.value < a || n.value > b { opChain.fail(AssertionFailure{ Type: AssertInRange, Actual: &AssertionValue{n.value}, @@ -746,7 +746,7 @@ func (n *Number) IsGt(value interface{}) *Number { return n } - if !(n.value > num) { + if n.value <= num { opChain.fail(AssertionFailure{ Type: AssertGt, Actual: &AssertionValue{n.value}, @@ -783,7 +783,7 @@ func (n *Number) IsGe(value interface{}) *Number { return n } - if !(n.value >= num) { + if n.value < num { opChain.fail(AssertionFailure{ Type: AssertGe, Actual: &AssertionValue{n.value}, @@ -820,7 +820,7 @@ func (n *Number) IsLt(value interface{}) *Number { return n } - if !(n.value < num) { + if n.value >= num { opChain.fail(AssertionFailure{ Type: AssertLt, Actual: &AssertionValue{n.value}, @@ -857,7 +857,7 @@ func (n *Number) IsLe(value interface{}) *Number { return n } - if !(n.value <= num) { + if n.value > num { opChain.fail(AssertionFailure{ Type: AssertLe, Actual: &AssertionValue{n.value}, @@ -951,7 +951,7 @@ func (n *Number) IsInt(bits ...int) *Number { } inum, acc := big.NewFloat(n.value).Int(nil) - if !(acc == big.Exact) { + if acc != big.Exact { opChain.fail(AssertionFailure{ Type: AssertValid, Actual: &AssertionValue{n.value}, @@ -1059,7 +1059,7 @@ func (n *Number) NotInt(bits ...int) *Number { imin := new(big.Int) imin.Neg(imax) imin.Sub(imin, big.NewInt(1)) - if !(inum.Cmp(imin) < 0 || inum.Cmp(imax) > 0) { + if inum.Cmp(imin) >= 0 && inum.Cmp(imax) <= 0 { opChain.fail(AssertionFailure{ Type: AssertNotInRange, Actual: &AssertionValue{n.value}, @@ -1141,7 +1141,7 @@ func (n *Number) IsUint(bits ...int) *Number { } inum, acc := big.NewFloat(n.value).Int(nil) - if !(acc == big.Exact) { + if acc != big.Exact { opChain.fail(AssertionFailure{ Type: AssertValid, Actual: &AssertionValue{n.value}, @@ -1333,7 +1333,7 @@ func (n *Number) NotFinite() *Number { return n } - if !(math.IsInf(n.value, 0) || math.IsNaN(n.value)) { + if !(math.IsInf(n.value, 0) || math.IsNaN(n.value)) { //nolint:staticcheck opChain.fail(AssertionFailure{ Type: AssertValid, Actual: &AssertionValue{n.value}, diff --git a/object.go b/object.go index 6d1e88b4b..97ccecae3 100644 --- a/object.go +++ b/object.go @@ -754,7 +754,7 @@ func (o *Object) IsEmpty() *Object { return o } - if !(len(o.value) == 0) { + if len(o.value) != 0 { opChain.fail(AssertionFailure{ Type: AssertEmpty, Actual: &AssertionValue{o.value}, @@ -1218,7 +1218,7 @@ func (o *Object) sortedKV() []kv { } func containsKey( - opChain *chain, obj map[string]interface{}, key string, + _ *chain, obj map[string]interface{}, key string, ) bool { for k := range obj { if k == key { diff --git a/object_test.go b/object_test.go index 091366be2..74fe4fe97 100644 --- a/object_test.go +++ b/object_test.go @@ -656,7 +656,6 @@ func TestObject_InList(t *testing.T) { t.Run("canonization", func(t *testing.T) { type ( myMap map[string]interface{} - myInt int ) reporter := newMockReporter(t) diff --git a/printer.go b/printer.go index 8638ab618..feb5e4536 100644 --- a/printer.go +++ b/printer.go @@ -127,7 +127,7 @@ func (p DebugPrinter) Response(resp *http.Response, duration time.Duration) { panic(err) } - text := strings.Replace(string(dump), "\r\n", "\n", -1) + text := strings.ReplaceAll(string(dump), "\r\n", "\n") lines := strings.SplitN(text, "\n", 2) p.logger.Logf("%s %s\n%s", lines[0], duration, lines[1]) @@ -136,37 +136,37 @@ func (p DebugPrinter) Response(resp *http.Response, duration time.Duration) { // WebsocketWrite implements WebsocketPrinter.WebsocketWrite. func (p DebugPrinter) WebsocketWrite(typ int, content []byte, closeCode int) { b := &bytes.Buffer{} - fmt.Fprintf(b, "-> Sent: %s", wsMessageType(typ)) + _, _ = fmt.Fprintf(b, "-> Sent: %s", wsMessageType(typ)) if typ == websocket.CloseMessage { - fmt.Fprintf(b, " %s", wsCloseCode(closeCode)) + _, _ = fmt.Fprintf(b, " %s", wsCloseCode(closeCode)) } - fmt.Fprint(b, "\n") + _, _ = fmt.Fprint(b, "\n") if len(content) > 0 { if typ == websocket.BinaryMessage { - fmt.Fprintf(b, "%v\n", content) + _, _ = fmt.Fprintf(b, "%v\n", content) } else { - fmt.Fprintf(b, "%s\n", content) + _, _ = fmt.Fprintf(b, "%s\n", content) } } - fmt.Fprintf(b, "\n") + _, _ = fmt.Fprintf(b, "\n") p.logger.Logf(b.String()) } // WebsocketRead implements WebsocketPrinter.WebsocketRead. func (p DebugPrinter) WebsocketRead(typ int, content []byte, closeCode int) { b := &bytes.Buffer{} - fmt.Fprintf(b, "<- Received: %s", wsMessageType(typ)) + _, _ = fmt.Fprintf(b, "<- Received: %s", wsMessageType(typ)) if typ == websocket.CloseMessage { - fmt.Fprintf(b, " %s", wsCloseCode(closeCode)) + _, _ = fmt.Fprintf(b, " %s", wsCloseCode(closeCode)) } - fmt.Fprint(b, "\n") + _, _ = fmt.Fprint(b, "\n") if len(content) > 0 { if typ == websocket.BinaryMessage { - fmt.Fprintf(b, "%v\n", content) + _, _ = fmt.Fprintf(b, "%v\n", content) } else { - fmt.Fprintf(b, "%s\n", content) + _, _ = fmt.Fprintf(b, "%s\n", content) } } - fmt.Fprintf(b, "\n") + _, _ = fmt.Fprintf(b, "\n") p.logger.Logf(b.String()) } diff --git a/reporter_test.go b/reporter_test.go index 3e0dd6ccf..8e94289df 100644 --- a/reporter_test.go +++ b/reporter_test.go @@ -11,7 +11,7 @@ type mockT struct { fatalfInvoked bool } -func (m *mockT) Fatalf(format string, args ...interface{}) { +func (m *mockT) Fatalf(_ string, _ ...interface{}) { m.fatalfInvoked = true } @@ -19,7 +19,7 @@ type mockAssertT struct { errorfInvoked bool } -func (m *mockAssertT) Errorf(format string, args ...interface{}) { +func (m *mockAssertT) Errorf(_ string, _ ...interface{}) { m.errorfInvoked = true } diff --git a/request.go b/request.go index 9c5e42e75..a2068b127 100644 --- a/request.go +++ b/request.go @@ -901,7 +901,7 @@ func (r *Request) WithRetryDelay(minDelay, maxDelay time.Duration) *Request { return r } - if !(minDelay <= maxDelay) { + if minDelay > maxDelay { opChain.fail(AssertionFailure{ Type: AssertValid, Actual: &AssertionValue{ @@ -2152,7 +2152,7 @@ func (r *Request) withFile( return } rd = f - defer f.Close() + defer f.Close() // nolint:errcheck } if _, err := io.Copy(wr, rd); err != nil { @@ -2414,7 +2414,7 @@ func (r *Request) sendWebsocketRequest(opChain *chain) ( return resp, err }) - if err != nil && err != websocket.ErrBadHandshake { + if err != nil && !errors.Is(err, websocket.ErrBadHandshake) { opChain.fail(AssertionFailure{ Type: AssertOperation, Errors: []error{ @@ -2515,7 +2515,7 @@ func (r *Request) retryRequest(reqFunc func() (*http.Response, error)) ( } if resp != nil && resp.Body != nil { - resp.Body.Close() + resp.Body.Close() // nolint:errcheck } if configCtx := r.config.Context; configCtx != nil { @@ -2601,10 +2601,7 @@ func (r *Request) setupRedirects(opChain *chain) { "WithRedirectPolicy() can be used only if Client is *http.Client"), }, }) - return - } - - if r.maxRedirects != -1 { + } else if r.maxRedirects != -1 { opChain.fail(AssertionFailure{ Type: AssertUsage, Errors: []error{ @@ -2612,14 +2609,14 @@ func (r *Request) setupRedirects(opChain *chain) { "WithMaxRedirects() can be used only if Client is *http.Client"), }, }) - return - } - } else { - if r.redirectPolicy != defaultRedirectPolicy || r.maxRedirects != -1 { - clientCopy := *httpClient - httpClient = &clientCopy - r.config.Client = &clientCopy } + return + } + + if r.redirectPolicy != defaultRedirectPolicy || r.maxRedirects != -1 { + clientCopy := *httpClient + httpClient = &clientCopy + r.config.Client = &clientCopy } if r.redirectPolicy == DontFollowRedirects { diff --git a/request_test.go b/request_test.go index a0d3c7657..d3cd4997e 100644 --- a/request_test.go +++ b/request_test.go @@ -1811,8 +1811,8 @@ func TestRequest_BodyMultipart(t *testing.T) { fh, _ := os.CreateTemp("", "httpexpect") filename2 := fh.Name() _, _ = fh.WriteString("2") - fh.Close() - defer os.Remove(filename2) + _ = fh.Close() + defer os.Remove(filename2) // nolint:errcheck req.WithMultipart() req.WithForm(map[string]string{"a": "1"}) diff --git a/response.go b/response.go index f1740135b..a257dff89 100644 --- a/response.go +++ b/response.go @@ -186,7 +186,7 @@ func (r *Response) getContent(opChain *chain, method string) ([]byte, bool) { content, err := io.ReadAll(resp.Body) - closeErr := resp.Body.Close() + closeErr := resp.Body.Close() // nolint:errcheck if err == nil { err = closeErr } diff --git a/string.go b/string.go index 2720315d6..f9b46194c 100644 --- a/string.go +++ b/string.go @@ -139,7 +139,7 @@ func (s *String) IsEmpty() *String { return s } - if !(s.value == "") { + if s.value != "" { opChain.fail(AssertionFailure{ Type: AssertEmpty, Actual: &AssertionValue{s.value}, @@ -198,7 +198,7 @@ func (s *String) IsEqual(value string) *String { return s } - if !(s.value == value) { + if s.value != value { opChain.fail(AssertionFailure{ Type: AssertEqual, Actual: &AssertionValue{s.value}, diff --git a/value.go b/value.go index 801de234a..c973dfa8c 100644 --- a/value.go +++ b/value.go @@ -404,7 +404,7 @@ func (v *Value) IsNull() *Value { return v } - if !(v.value == nil) { + if v.value != nil { opChain.fail(AssertionFailure{ Type: AssertNil, Actual: &AssertionValue{v.value}, diff --git a/value_test.go b/value_test.go index 8997e48e7..e44ec04e5 100644 --- a/value_test.go +++ b/value_test.go @@ -893,13 +893,11 @@ func TestValue_PathTypes(t *testing.T) { }) t.Run("boolean", func(t *testing.T) { - data := true - reporter := newMockReporter(t) - value := NewValue(reporter, data) + value := NewValue(reporter, true) - assert.Equal(t, data, value.Path("$").Raw()) + assert.Equal(t, true, value.Path("$").Raw()) value.chain.assert(t, success) }) @@ -1216,7 +1214,7 @@ func TestValue_Schema(t *testing.T) { "bar": 1, } tmp, _ := os.CreateTemp("", "httpexpect") - defer os.Remove(tmp.Name()) + defer os.Remove(tmp.Name()) // nolint:errcheck _, err := tmp.Write([]byte(schema)) require.Nil(t, err) @@ -1241,7 +1239,7 @@ func TestValue_Schema(t *testing.T) { } tmp, _ := os.CreateTemp("", "httpexpect") - defer os.Remove(tmp.Name()) + defer os.Remove(tmp.Name()) // nolint:errcheck _, err := tmp.Write([]byte(schema)) require.Nil(t, err) diff --git a/websocket_test.go b/websocket_test.go index 2ebe9b44f..baa55b298 100644 --- a/websocket_test.go +++ b/websocket_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/assert" ) -func noWsPreSteps(ws *Websocket) {} +func noWsPreSteps(_ *Websocket) {} func TestWebsocket_FailedChain(t *testing.T) { reporter := newMockReporter(t)