diff --git a/cmd/cloud-controller-manager-aws-tests-ext/go.mod b/cmd/cloud-controller-manager-aws-tests-ext/go.mod index bdf63933b..8ba761104 100644 --- a/cmd/cloud-controller-manager-aws-tests-ext/go.mod +++ b/cmd/cloud-controller-manager-aws-tests-ext/go.mod @@ -109,17 +109,17 @@ require ( go.opentelemetry.io/proto/otlp v1.5.0 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/crypto v0.45.0 // indirect + golang.org/x/crypto v0.50.0 // indirect golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 // indirect - golang.org/x/mod v0.29.0 // indirect - golang.org/x/net v0.47.0 // indirect + golang.org/x/mod v0.34.0 // indirect + golang.org/x/net v0.53.0 // indirect golang.org/x/oauth2 v0.30.0 // indirect - golang.org/x/sync v0.18.0 // indirect - golang.org/x/sys v0.38.0 // indirect - golang.org/x/term v0.37.0 // indirect - golang.org/x/text v0.31.0 // indirect + golang.org/x/sync v0.20.0 // indirect + golang.org/x/sys v0.43.0 // indirect + golang.org/x/term v0.42.0 // indirect + golang.org/x/text v0.36.0 // indirect golang.org/x/time v0.11.0 // indirect - golang.org/x/tools v0.38.0 // indirect + golang.org/x/tools v0.43.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a // indirect google.golang.org/grpc v1.72.2 // indirect diff --git a/cmd/cloud-controller-manager-aws-tests-ext/go.sum b/cmd/cloud-controller-manager-aws-tests-ext/go.sum index 334c23526..0777005c2 100644 --- a/cmd/cloud-controller-manager-aws-tests-ext/go.sum +++ b/cmd/cloud-controller-manager-aws-tests-ext/go.sum @@ -228,29 +228,29 @@ go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -golang.org/x/crypto v0.45.0 h1:jMBrvKuj23MTlT0bQEOBcAE0mjg8mK9RXFhRH6nyF3Q= -golang.org/x/crypto v0.45.0/go.mod h1:XTGrrkGJve7CYK7J8PEww4aY7gM3qMCElcJQ8n8JdX4= +golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI= +golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= -golang.org/x/mod v0.29.0 h1:HV8lRxZC4l2cr3Zq1LvtOsi/ThTgWnUk/y64QSs8GwA= -golang.org/x/mod v0.29.0/go.mod h1:NyhrlYXJ2H4eJiRy/WDBO6HMqZQ6q9nk4JzS3NuCK+w= -golang.org/x/net v0.47.0 h1:Mx+4dIFzqraBXUugkia1OOvlD6LemFo1ALMHjrXDOhY= -golang.org/x/net v0.47.0/go.mod h1:/jNxtkgq5yWUGYkaZGqo27cfGZ1c5Nen03aYrrKpVRU= +golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI= +golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY= +golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= +golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= golang.org/x/oauth2 v0.30.0 h1:dnDm7JmhM45NNpd8FDDeLhK6FwqbOf4MLCM9zb1BOHI= golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKlU= -golang.org/x/sync v0.18.0 h1:kr88TuHDroi+UVf+0hZnirlk8o8T+4MrK6mr60WkH/I= -golang.org/x/sync v0.18.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc= -golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/term v0.37.0 h1:8EGAD0qCmHYZg6J17DvsMy9/wJ7/D/4pV/wfnld5lTU= -golang.org/x/term v0.37.0/go.mod h1:5pB4lxRNYYVZuTLmy8oR2BH8dflOR+IbTYFD8fi3254= -golang.org/x/text v0.31.0 h1:aC8ghyu4JhP8VojJ2lEHBnochRno1sgL6nEi9WGFGMM= -golang.org/x/text v0.31.0/go.mod h1:tKRAlv61yKIjGGHX/4tP1LTbc13YSec1pxVEWXzfoeM= +golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= +golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY= +golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY= +golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= +golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= golang.org/x/time v0.11.0 h1:/bpjEDfN9tkoN/ryeYHnv5hcMlc8ncjMcM4XBk5NWV0= golang.org/x/time v0.11.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= -golang.org/x/tools v0.38.0 h1:Hx2Xv8hISq8Lm16jvBZ2VQf+RLmbd7wVUsALibYI/IQ= -golang.org/x/tools v0.38.0/go.mod h1:yEsQ/d/YK8cjh0L6rZlY8tgtlKiBNTL14pGDJPJpYQs= +golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s= +golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0= google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb h1:p31xT4yrYrSM/G4Sn2+TNUkVhFCbG9y8itM2S6Th950= google.golang.org/genproto/googleapis/api v0.0.0-20250303144028-a0af3efb3deb/go.mod h1:jbe3Bkdp+Dh2IrslsFCklNhweNTBgSYanP1UXhJDhKg= google.golang.org/genproto/googleapis/rpc v0.0.0-20250528174236-200df99c418a h1:v2PbRU4K3llS09c7zodFpNePeamkAwG3mPrAery9VeE= diff --git a/go.mod b/go.mod index a79527bc3..2048d3dcd 100644 --- a/go.mod +++ b/go.mod @@ -300,18 +300,18 @@ require ( go.uber.org/zap v1.27.0 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/crypto v0.48.0 // indirect + golang.org/x/crypto v0.50.0 // indirect golang.org/x/exp v0.0.0-20250911091902-df9299821621 // indirect golang.org/x/exp/typeparams v0.0.0-20260209203927-2842357ff358 // indirect - golang.org/x/mod v0.33.0 // indirect - golang.org/x/net v0.51.0 // indirect + golang.org/x/mod v0.34.0 // indirect + golang.org/x/net v0.53.0 // indirect golang.org/x/oauth2 v0.34.0 // indirect - golang.org/x/sync v0.19.0 // indirect - golang.org/x/sys v0.41.0 // indirect - golang.org/x/term v0.40.0 // indirect - golang.org/x/text v0.34.0 // indirect + golang.org/x/sync v0.20.0 // indirect + golang.org/x/sys v0.43.0 // indirect + golang.org/x/term v0.42.0 // indirect + golang.org/x/text v0.36.0 // indirect golang.org/x/time v0.14.0 // indirect - golang.org/x/tools v0.42.0 // indirect + golang.org/x/tools v0.43.0 // indirect gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250826171959-ef028d996bc1 // indirect diff --git a/go.sum b/go.sum index fc424c68c..2f35030e3 100644 --- a/go.sum +++ b/go.sum @@ -681,8 +681,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= -golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= +golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI= +golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q= golang.org/x/exp v0.0.0-20250911091902-df9299821621 h1:2id6c1/gto0kaHYyrixvknJ8tUK/Qs5IsmBtrc+FtgU= golang.org/x/exp v0.0.0-20250911091902-df9299821621/go.mod h1:TwQYMMnGpvZyc+JpB/UAuTNIsVJifOlSkrZkhcvpVUk= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= @@ -698,8 +698,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8= -golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w= +golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI= +golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY= 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-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= @@ -713,8 +713,8 @@ golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.51.0 h1:94R/GTO7mt3/4wIKpcR5gkGmRLOuE/2hNGeWq/GBIFo= -golang.org/x/net v0.51.0/go.mod h1:aamm+2QF5ogm02fjy5Bb7CQ0WMt1/WVM7FtyaTLlA9Y= +golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= +golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -726,8 +726,8 @@ golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= -golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= -golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= 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-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -748,16 +748,16 @@ golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= -golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= +golang.org/x/sys v0.43.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/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= -golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg= -golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM= +golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY= +golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -766,8 +766,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= -golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= +golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= +golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -782,8 +782,8 @@ golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= -golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k= -golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0= +golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s= +golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0= golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= diff --git a/openshift-tests/operator-tests/go.mod b/openshift-tests/operator-tests/go.mod index 2ab17cd51..ed3c87f5d 100644 --- a/openshift-tests/operator-tests/go.mod +++ b/openshift-tests/operator-tests/go.mod @@ -71,17 +71,17 @@ require ( go.opentelemetry.io/proto/otlp v1.7.1 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect - golang.org/x/crypto v0.48.0 // indirect + golang.org/x/crypto v0.50.0 // indirect golang.org/x/exp v0.0.0-20250911091902-df9299821621 // indirect - golang.org/x/mod v0.33.0 // indirect - golang.org/x/net v0.51.0 // indirect + golang.org/x/mod v0.34.0 // indirect + golang.org/x/net v0.53.0 // indirect golang.org/x/oauth2 v0.34.0 // indirect - golang.org/x/sync v0.19.0 // indirect - golang.org/x/sys v0.41.0 // indirect - golang.org/x/term v0.40.0 // indirect - golang.org/x/text v0.34.0 // indirect + golang.org/x/sync v0.20.0 // indirect + golang.org/x/sys v0.43.0 // indirect + golang.org/x/term v0.42.0 // indirect + golang.org/x/text v0.36.0 // indirect golang.org/x/time v0.14.0 // indirect - golang.org/x/tools v0.42.0 // indirect + golang.org/x/tools v0.43.0 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250826171959-ef028d996bc1 // indirect google.golang.org/grpc v1.75.0 // indirect diff --git a/openshift-tests/operator-tests/go.sum b/openshift-tests/operator-tests/go.sum index 45fd52c35..132e0bd85 100644 --- a/openshift-tests/operator-tests/go.sum +++ b/openshift-tests/operator-tests/go.sum @@ -185,28 +185,28 @@ go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts= -golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos= +golang.org/x/crypto v0.50.0 h1:zO47/JPrL6vsNkINmLoo/PH1gcxpls50DNogFvB5ZGI= +golang.org/x/crypto v0.50.0/go.mod h1:3muZ7vA7PBCE6xgPX7nkzzjiUq87kRItoJQM1Yo8S+Q= golang.org/x/exp v0.0.0-20250911091902-df9299821621 h1:2id6c1/gto0kaHYyrixvknJ8tUK/Qs5IsmBtrc+FtgU= golang.org/x/exp v0.0.0-20250911091902-df9299821621/go.mod h1:TwQYMMnGpvZyc+JpB/UAuTNIsVJifOlSkrZkhcvpVUk= -golang.org/x/mod v0.33.0 h1:tHFzIWbBifEmbwtGz65eaWyGiGZatSrT9prnU8DbVL8= -golang.org/x/mod v0.33.0/go.mod h1:swjeQEj+6r7fODbD2cqrnje9PnziFuw4bmLbBZFrQ5w= -golang.org/x/net v0.51.0 h1:94R/GTO7mt3/4wIKpcR5gkGmRLOuE/2hNGeWq/GBIFo= -golang.org/x/net v0.51.0/go.mod h1:aamm+2QF5ogm02fjy5Bb7CQ0WMt1/WVM7FtyaTLlA9Y= +golang.org/x/mod v0.34.0 h1:xIHgNUUnW6sYkcM5Jleh05DvLOtwc6RitGHbDk4akRI= +golang.org/x/mod v0.34.0/go.mod h1:ykgH52iCZe79kzLLMhyCUzhMci+nQj+0XkbXpNYtVjY= +golang.org/x/net v0.53.0 h1:d+qAbo5L0orcWAr0a9JweQpjXF19LMXJE8Ey7hwOdUA= +golang.org/x/net v0.53.0/go.mod h1:JvMuJH7rrdiCfbeHoo3fCQU24Lf5JJwT9W3sJFulfgs= golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= -golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4= -golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= -golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= -golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg= -golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM= -golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk= -golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA= +golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= +golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sys v0.43.0 h1:Rlag2XtaFTxp19wS8MXlJwTvoh8ArU6ezoyFsMyCTNI= +golang.org/x/sys v0.43.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.42.0 h1:UiKe+zDFmJobeJ5ggPwOshJIVt6/Ft0rcfrXZDLWAWY= +golang.org/x/term v0.42.0/go.mod h1:Dq/D+snpsbazcBG5+F9Q1n2rXV8Ma+71xEjTRufARgY= +golang.org/x/text v0.36.0 h1:JfKh3XmcRPqZPKevfXVpI1wXPTqbkE5f7JA92a55Yxg= +golang.org/x/text v0.36.0/go.mod h1:NIdBknypM8iqVmPiuco0Dh6P5Jcdk8lJL0CUebqK164= golang.org/x/time v0.14.0 h1:MRx4UaLrDotUKUdCIqzPC48t1Y9hANFKIRpNx+Te8PI= golang.org/x/time v0.14.0/go.mod h1:eL/Oa2bBBK0TkX57Fyni+NgnyQQN4LitPmob2Hjnqw4= -golang.org/x/tools v0.42.0 h1:uNgphsn75Tdz5Ji2q36v/nsFSfR/9BRFvqhGBaJGd5k= -golang.org/x/tools v0.42.0/go.mod h1:Ma6lCIwGZvHK6XtgbswSoWroEkhugApmsXyrUmBhfr0= +golang.org/x/tools v0.43.0 h1:12BdW9CeB3Z+J/I/wj34VMl8X+fEXBxVR90JeMX5E7s= +golang.org/x/tools v0.43.0/go.mod h1:uHkMso649BX2cZK6+RpuIPXS3ho2hZo4FVwfoy1vIk0= gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= google.golang.org/genproto/googleapis/api v0.0.0-20250826171959-ef028d996bc1 h1:APHvLLYBhtZvsbnpkfknDZ7NyH4z5+ub/I0u8L3Oz6g= diff --git a/vendor/golang.org/x/crypto/ssh/cipher.go b/vendor/golang.org/x/crypto/ssh/cipher.go index 7554ed57a..ad2b37057 100644 --- a/vendor/golang.org/x/crypto/ssh/cipher.go +++ b/vendor/golang.org/x/crypto/ssh/cipher.go @@ -586,7 +586,7 @@ func (c *cbcCipher) writeCipherPacket(seqNum uint32, w io.Writer, rand io.Reader // Length of encrypted portion of the packet (header, payload, padding). // Enforce minimum padding and packet size. - encLength := maxUInt32(prefixLen+len(packet)+cbcMinPaddingSize, cbcMinPaddingSize) + encLength := maxUInt32(prefixLen+len(packet)+cbcMinPaddingSize, cbcMinPacketSize) // Enforce block size. encLength = (encLength + effectiveBlockSize - 1) / effectiveBlockSize * effectiveBlockSize diff --git a/vendor/golang.org/x/crypto/ssh/client_auth.go b/vendor/golang.org/x/crypto/ssh/client_auth.go index 3127e4990..4f2f75c36 100644 --- a/vendor/golang.org/x/crypto/ssh/client_auth.go +++ b/vendor/golang.org/x/crypto/ssh/client_auth.go @@ -274,10 +274,14 @@ func pickSignatureAlgorithm(signer Signer, extensions map[string][]byte) (MultiA } // Filter algorithms based on those supported by MultiAlgorithmSigner. + // Iterate over the signer's algorithms first to preserve its preference order. + supportedKeyAlgos := algorithmsForKeyFormat(keyFormat) var keyAlgos []string - for _, algo := range algorithmsForKeyFormat(keyFormat) { - if slices.Contains(as.Algorithms(), underlyingAlgo(algo)) { - keyAlgos = append(keyAlgos, algo) + for _, signerAlgo := range as.Algorithms() { + if idx := slices.IndexFunc(supportedKeyAlgos, func(algo string) bool { + return underlyingAlgo(algo) == signerAlgo + }); idx >= 0 { + keyAlgos = append(keyAlgos, supportedKeyAlgos[idx]) } } diff --git a/vendor/golang.org/x/net/http2/hpack/tables.go b/vendor/golang.org/x/net/http2/hpack/tables.go index 8cbdf3f01..803fe5178 100644 --- a/vendor/golang.org/x/net/http2/hpack/tables.go +++ b/vendor/golang.org/x/net/http2/hpack/tables.go @@ -6,6 +6,7 @@ package hpack import ( "fmt" + "strings" ) // headerFieldTable implements a list of HeaderFields. @@ -54,10 +55,16 @@ func (t *headerFieldTable) len() int { // addEntry adds a new entry. func (t *headerFieldTable) addEntry(f HeaderField) { + // Prevent f from escaping to the heap. + f2 := HeaderField{ + Name: strings.Clone(f.Name), + Value: strings.Clone(f.Value), + Sensitive: f.Sensitive, + } id := uint64(t.len()) + t.evictCount + 1 - t.byName[f.Name] = id - t.byNameValue[pairNameValue{f.Name, f.Value}] = id - t.ents = append(t.ents, f) + t.byName[f2.Name] = id + t.byNameValue[pairNameValue{f2.Name, f2.Value}] = id + t.ents = append(t.ents, f2) } // evictOldest evicts the n oldest entries in the table. diff --git a/vendor/golang.org/x/net/http2/http2.go b/vendor/golang.org/x/net/http2/http2.go index 6320f4eb4..0b99d832f 100644 --- a/vendor/golang.org/x/net/http2/http2.go +++ b/vendor/golang.org/x/net/http2/http2.go @@ -4,13 +4,17 @@ // Package http2 implements the HTTP/2 protocol. // -// This package is low-level and intended to be used directly by very -// few people. Most users will use it indirectly through the automatic -// use by the net/http package (from Go 1.6 and later). -// For use in earlier Go versions see ConfigureServer. (Transport support -// requires Go 1.6 or later) +// Almost no users should need to import this package directly. +// The net/http package supports HTTP/2 natively. // -// See https://http2.github.io/ for more information on HTTP/2. +// To enable or disable HTTP/2 support in net/http clients and servers, see +// [http.Transport.Protocols] and [http.Server.Protocols]. +// +// To configure HTTP/2 parameters, see +// [http.Transport.HTTP2] and [http.Server.HTTP2]. +// +// To create HTTP/1 or HTTP/2 connections, see +// [http.Transport.NewClientConn]. package http2 // import "golang.org/x/net/http2" import ( diff --git a/vendor/golang.org/x/net/http2/server.go b/vendor/golang.org/x/net/http2/server.go index 7ef807f79..65da5175c 100644 --- a/vendor/golang.org/x/net/http2/server.go +++ b/vendor/golang.org/x/net/http2/server.go @@ -164,6 +164,8 @@ type Server struct { // NewWriteScheduler constructs a write scheduler for a connection. // If nil, a default scheduler is chosen. + // + // Deprecated: User-provided write schedulers are deprecated. NewWriteScheduler func() WriteScheduler // CountError, if non-nil, is called on HTTP/2 server errors. diff --git a/vendor/golang.org/x/net/http2/transport.go b/vendor/golang.org/x/net/http2/transport.go index 8cf64b78e..19553f10c 100644 --- a/vendor/golang.org/x/net/http2/transport.go +++ b/vendor/golang.org/x/net/http2/transport.go @@ -712,19 +712,12 @@ func canRetryError(err error) bool { return true } if se, ok := err.(StreamError); ok { - if se.Code == ErrCodeProtocol && se.Cause == errFromPeer { - // See golang/go#47635, golang/go#42777 - return true - } return se.Code == ErrCodeRefusedStream } return false } func (t *Transport) dialClientConn(ctx context.Context, addr string, singleUse bool) (*ClientConn, error) { - if t.transportTestHooks != nil { - return t.newClientConn(nil, singleUse, nil) - } host, _, err := net.SplitHostPort(addr) if err != nil { return nil, err @@ -2865,6 +2858,9 @@ func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { var seenMaxConcurrentStreams bool err := f.ForeachSetting(func(s Setting) error { + if err := s.Valid(); err != nil { + return err + } switch s.ID { case SettingMaxFrameSize: cc.maxFrameSize = s.Val @@ -2896,9 +2892,6 @@ func (rl *clientConnReadLoop) processSettingsNoWrite(f *SettingsFrame) error { cc.henc.SetMaxDynamicTableSize(s.Val) cc.peerMaxHeaderTableSize = s.Val case SettingEnableConnectProtocol: - if err := s.Valid(); err != nil { - return err - } // If the peer wants to send us SETTINGS_ENABLE_CONNECT_PROTOCOL, // we require that it do so in the first SETTINGS frame. // @@ -3233,10 +3226,6 @@ func (gz *gzipReader) Close() error { return gz.body.Close() } -type errorReader struct{ err error } - -func (r errorReader) Read(p []byte) (int, error) { return 0, r.err } - // isConnectionCloseRequest reports whether req should use its own // connection for a single request and then close the connection. func isConnectionCloseRequest(req *http.Request) bool { diff --git a/vendor/golang.org/x/net/http2/writesched.go b/vendor/golang.org/x/net/http2/writesched.go index 7de27be52..551545f31 100644 --- a/vendor/golang.org/x/net/http2/writesched.go +++ b/vendor/golang.org/x/net/http2/writesched.go @@ -8,6 +8,8 @@ import "fmt" // WriteScheduler is the interface implemented by HTTP/2 write schedulers. // Methods are never called concurrently. +// +// Deprecated: User-provided write schedulers are deprecated. type WriteScheduler interface { // OpenStream opens a new stream in the write scheduler. // It is illegal to call this with streamID=0 or with a streamID that is @@ -38,6 +40,8 @@ type WriteScheduler interface { } // OpenStreamOptions specifies extra options for WriteScheduler.OpenStream. +// +// Deprecated: User-provided write schedulers are deprecated. type OpenStreamOptions struct { // PusherID is zero if the stream was initiated by the client. Otherwise, // PusherID names the stream that pushed the newly opened stream. @@ -47,6 +51,8 @@ type OpenStreamOptions struct { } // FrameWriteRequest is a request to write a frame. +// +// Deprecated: User-provided write schedulers are deprecated. type FrameWriteRequest struct { // write is the interface value that does the writing, once the // WriteScheduler has selected this frame to write. The write diff --git a/vendor/golang.org/x/net/http2/writesched_priority_rfc7540.go b/vendor/golang.org/x/net/http2/writesched_priority_rfc7540.go index 7803a9261..c3d3e9bed 100644 --- a/vendor/golang.org/x/net/http2/writesched_priority_rfc7540.go +++ b/vendor/golang.org/x/net/http2/writesched_priority_rfc7540.go @@ -14,6 +14,8 @@ import ( const priorityDefaultWeightRFC7540 = 15 // 16 = 15 + 1 // PriorityWriteSchedulerConfig configures a priorityWriteScheduler. +// +// Deprecated: User-provided write schedulers are deprecated. type PriorityWriteSchedulerConfig struct { // MaxClosedNodesInTree controls the maximum number of closed streams to // retain in the priority tree. Setting this to zero saves a small amount @@ -55,6 +57,9 @@ type PriorityWriteSchedulerConfig struct { // NewPriorityWriteScheduler constructs a WriteScheduler that schedules // frames by following HTTP/2 priorities as described in RFC 7540 Section 5.3. // If cfg is nil, default options are used. +// +// Deprecated: The RFC 7540 write scheduler has known bugs and performance issues, +// and RFC 7540 prioritization was deprecated in RFC 9113. func NewPriorityWriteScheduler(cfg *PriorityWriteSchedulerConfig) WriteScheduler { return newPriorityWriteSchedulerRFC7540(cfg) } diff --git a/vendor/golang.org/x/net/http2/writesched_random.go b/vendor/golang.org/x/net/http2/writesched_random.go index f2e55e05c..d5d4e2214 100644 --- a/vendor/golang.org/x/net/http2/writesched_random.go +++ b/vendor/golang.org/x/net/http2/writesched_random.go @@ -10,6 +10,8 @@ import "math" // priorities. Control frames like SETTINGS and PING are written before DATA // frames, but if no control frames are queued and multiple streams have queued // HEADERS or DATA frames, Pop selects a ready stream arbitrarily. +// +// Deprecated: User-provided write schedulers are deprecated. func NewRandomWriteScheduler() WriteScheduler { return &randomWriteScheduler{sq: make(map[uint32]*writeQueue)} } diff --git a/vendor/golang.org/x/sync/singleflight/singleflight.go b/vendor/golang.org/x/sync/singleflight/singleflight.go index 405183098..90ca138af 100644 --- a/vendor/golang.org/x/sync/singleflight/singleflight.go +++ b/vendor/golang.org/x/sync/singleflight/singleflight.go @@ -22,7 +22,7 @@ var errGoexit = errors.New("runtime.Goexit was called") // A panicError is an arbitrary value recovered from a panic // with the stack trace during the execution of given function. type panicError struct { - value interface{} + value any stack []byte } @@ -40,7 +40,7 @@ func (p *panicError) Unwrap() error { return err } -func newPanicError(v interface{}) error { +func newPanicError(v any) error { stack := debug.Stack() // The first line of the stack trace is of the form "goroutine N [status]:" @@ -58,7 +58,7 @@ type call struct { // These fields are written once before the WaitGroup is done // and are only read after the WaitGroup is done. - val interface{} + val any err error // These fields are read and written with the singleflight @@ -78,7 +78,7 @@ type Group struct { // Result holds the results of Do, so they can be passed // on a channel. type Result struct { - Val interface{} + Val any Err error Shared bool } @@ -88,7 +88,7 @@ type Result struct { // time. If a duplicate comes in, the duplicate caller waits for the // original to complete and receives the same results. // The return value shared indicates whether v was given to multiple callers. -func (g *Group) Do(key string, fn func() (interface{}, error)) (v interface{}, err error, shared bool) { +func (g *Group) Do(key string, fn func() (any, error)) (v any, err error, shared bool) { g.mu.Lock() if g.m == nil { g.m = make(map[string]*call) @@ -118,7 +118,7 @@ func (g *Group) Do(key string, fn func() (interface{}, error)) (v interface{}, e // results when they are ready. // // The returned channel will not be closed. -func (g *Group) DoChan(key string, fn func() (interface{}, error)) <-chan Result { +func (g *Group) DoChan(key string, fn func() (any, error)) <-chan Result { ch := make(chan Result, 1) g.mu.Lock() if g.m == nil { @@ -141,7 +141,7 @@ func (g *Group) DoChan(key string, fn func() (interface{}, error)) <-chan Result } // doCall handles the single call for a key. -func (g *Group) doCall(c *call, key string, fn func() (interface{}, error)) { +func (g *Group) doCall(c *call, key string, fn func() (any, error)) { normalReturn := false recovered := false diff --git a/vendor/golang.org/x/sys/cpu/asm_darwin_arm64_gc.s b/vendor/golang.org/x/sys/cpu/asm_darwin_arm64_gc.s new file mode 100644 index 000000000..e07fa75eb --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/asm_darwin_arm64_gc.s @@ -0,0 +1,12 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build darwin && arm64 && gc + +#include "textflag.h" + +TEXT libc_sysctlbyname_trampoline<>(SB),NOSPLIT,$0-0 + JMP libc_sysctlbyname(SB) +GLOBL ·libc_sysctlbyname_trampoline_addr(SB), RODATA, $8 +DATA ·libc_sysctlbyname_trampoline_addr(SB)/8, $libc_sysctlbyname_trampoline<>(SB) diff --git a/vendor/golang.org/x/sys/cpu/cpu_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_arm64.go index 6d8eb784b..5fc09e293 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_arm64.go @@ -44,14 +44,11 @@ func initOptions() { } func archInit() { - switch runtime.GOOS { - case "freebsd": + if runtime.GOOS == "freebsd" { readARM64Registers() - case "linux", "netbsd", "openbsd", "windows": + } else { + // Most platforms don't seem to allow directly reading these registers. doinit() - default: - // Many platforms don't seem to allow reading these registers. - setMinimalFeatures() } } diff --git a/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64.go new file mode 100644 index 000000000..0b470744a --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64.go @@ -0,0 +1,67 @@ +// Copyright 2026 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build darwin && arm64 && gc + +package cpu + +func doinit() { + setMinimalFeatures() + + // The feature flags are explained in [Instruction Set Detection]. + // There are some differences between MacOS versions: + // + // MacOS 11 and 12 do not have "hw.optional" sysctl values for some of the features. + // + // MacOS 13 changed some of the naming conventions to align with ARM Architecture Reference Manual. + // For example "hw.optional.armv8_2_sha512" became "hw.optional.arm.FEAT_SHA512". + // It currently checks both to stay compatible with MacOS 11 and 12. + // The old names also work with MacOS 13, however it's not clear whether + // they will continue working with future OS releases. + // + // Once MacOS 12 is no longer supported the old names can be removed. + // + // [Instruction Set Detection]: https://developer.apple.com/documentation/kernel/1387446-sysctlbyname/determining_instruction_set_characteristics + + // Encryption, hashing and checksum capabilities + + // For the following flags there are no MacOS 11 sysctl flags. + ARM64.HasAES = true || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_AES\x00")) + ARM64.HasPMULL = true || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_PMULL\x00")) + ARM64.HasSHA1 = true || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SHA1\x00")) + ARM64.HasSHA2 = true || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SHA256\x00")) + + ARM64.HasSHA3 = darwinSysctlEnabled([]byte("hw.optional.armv8_2_sha3\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SHA3\x00")) + ARM64.HasSHA512 = darwinSysctlEnabled([]byte("hw.optional.armv8_2_sha512\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SHA512\x00")) + + ARM64.HasCRC32 = darwinSysctlEnabled([]byte("hw.optional.armv8_crc32\x00")) + + // Atomic and memory ordering + ARM64.HasATOMICS = darwinSysctlEnabled([]byte("hw.optional.armv8_1_atomics\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_LSE\x00")) + ARM64.HasLRCPC = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_LRCPC\x00")) + + // SIMD and floating point capabilities + ARM64.HasFPHP = darwinSysctlEnabled([]byte("hw.optional.neon_fp16\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_FP16\x00")) + ARM64.HasASIMDHP = darwinSysctlEnabled([]byte("hw.optional.neon_hpfp\x00")) || darwinSysctlEnabled([]byte("hw.optional.AdvSIMD_HPFPCvt\x00")) + ARM64.HasASIMDRDM = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_RDM\x00")) + ARM64.HasASIMDDP = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_DotProd\x00")) + ARM64.HasASIMDFHM = darwinSysctlEnabled([]byte("hw.optional.armv8_2_fhm\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_FHM\x00")) + ARM64.HasI8MM = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_I8MM\x00")) + + ARM64.HasJSCVT = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_JSCVT\x00")) + ARM64.HasFCMA = darwinSysctlEnabled([]byte("hw.optional.armv8_3_compnum\x00")) || darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_FCMA\x00")) + + // Miscellaneous + ARM64.HasDCPOP = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_DPB\x00")) + ARM64.HasEVTSTRM = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_ECV\x00")) + ARM64.HasDIT = darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_DIT\x00")) + + // Not supported, but added for completeness + ARM64.HasCPUID = false + + ARM64.HasSM3 = false // darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SM3\x00")) + ARM64.HasSM4 = false // darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SM4\x00")) + ARM64.HasSVE = false // darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SVE\x00")) + ARM64.HasSVE2 = false // darwinSysctlEnabled([]byte("hw.optional.arm.FEAT_SVE2\x00")) +} diff --git a/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64_other.go b/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64_other.go new file mode 100644 index 000000000..37ecc6644 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/cpu_darwin_arm64_other.go @@ -0,0 +1,31 @@ +// Copyright 2026 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build darwin && arm64 && !gc + +package cpu + +import "runtime" + +func doinit() { + setMinimalFeatures() + + ARM64.HasASIMD = true + ARM64.HasFP = true + + // Go already assumes these to be available because they were on the M1 + // and these are supported on all Apple arm64 chips. + ARM64.HasAES = true + ARM64.HasPMULL = true + ARM64.HasSHA1 = true + ARM64.HasSHA2 = true + + if runtime.GOOS != "ios" { + // Apple A7 processors do not support these, however + // M-series SoCs are at least armv8.4-a + ARM64.HasCRC32 = true // armv8.1 + ARM64.HasATOMICS = true // armv8.2 + ARM64.HasJSCVT = true // armv8.3, if HasFP + } +} diff --git a/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go index 7f1946780..05913081e 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_gccgo_arm64.go @@ -9,3 +9,4 @@ package cpu func getisar0() uint64 { return 0 } func getisar1() uint64 { return 0 } func getpfr0() uint64 { return 0 } +func getzfr0() uint64 { return 0 } diff --git a/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go index ff74d7afa..53f814d7a 100644 --- a/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go +++ b/vendor/golang.org/x/sys/cpu/cpu_other_arm64.go @@ -2,8 +2,10 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !linux && !netbsd && !openbsd && !windows && arm64 +//go:build !darwin && !linux && !netbsd && !openbsd && arm64 package cpu -func doinit() {} +func doinit() { + setMinimalFeatures() +} diff --git a/vendor/golang.org/x/sys/cpu/cpu_windows_arm64.go b/vendor/golang.org/x/sys/cpu/cpu_windows_arm64.go deleted file mode 100644 index d09e85a36..000000000 --- a/vendor/golang.org/x/sys/cpu/cpu_windows_arm64.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2026 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package cpu - -import ( - "golang.org/x/sys/windows" -) - -func doinit() { - // set HasASIMD and HasFP to true as per - // https://learn.microsoft.com/en-us/cpp/build/arm64-windows-abi-conventions?view=msvc-170#base-requirements - // - // The ARM64 version of Windows always presupposes that it's running on an ARMv8 or later architecture. - // Both floating-point and NEON support are presumed to be present in hardware. - // - ARM64.HasASIMD = true - ARM64.HasFP = true - - if windows.IsProcessorFeaturePresent(windows.PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE) { - ARM64.HasAES = true - ARM64.HasPMULL = true - ARM64.HasSHA1 = true - ARM64.HasSHA2 = true - } - ARM64.HasSHA3 = windows.IsProcessorFeaturePresent(windows.PF_ARM_SHA3_INSTRUCTIONS_AVAILABLE) - ARM64.HasCRC32 = windows.IsProcessorFeaturePresent(windows.PF_ARM_V8_CRC32_INSTRUCTIONS_AVAILABLE) - ARM64.HasSHA512 = windows.IsProcessorFeaturePresent(windows.PF_ARM_SHA512_INSTRUCTIONS_AVAILABLE) - ARM64.HasATOMICS = windows.IsProcessorFeaturePresent(windows.PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE) - if windows.IsProcessorFeaturePresent(windows.PF_ARM_V82_DP_INSTRUCTIONS_AVAILABLE) { - ARM64.HasASIMDDP = true - ARM64.HasASIMDRDM = true - } - if windows.IsProcessorFeaturePresent(windows.PF_ARM_V83_LRCPC_INSTRUCTIONS_AVAILABLE) { - ARM64.HasLRCPC = true - ARM64.HasSM3 = true - } - ARM64.HasSVE = windows.IsProcessorFeaturePresent(windows.PF_ARM_SVE_INSTRUCTIONS_AVAILABLE) - ARM64.HasSVE2 = windows.IsProcessorFeaturePresent(windows.PF_ARM_SVE2_INSTRUCTIONS_AVAILABLE) - ARM64.HasJSCVT = windows.IsProcessorFeaturePresent(windows.PF_ARM_V83_JSCVT_INSTRUCTIONS_AVAILABLE) -} diff --git a/vendor/golang.org/x/sys/cpu/syscall_darwin_arm64_gc.go b/vendor/golang.org/x/sys/cpu/syscall_darwin_arm64_gc.go new file mode 100644 index 000000000..7b4e67ff9 --- /dev/null +++ b/vendor/golang.org/x/sys/cpu/syscall_darwin_arm64_gc.go @@ -0,0 +1,54 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +// Minimal copy from internal/cpu and runtime to make sysctl calls. + +//go:build darwin && arm64 && gc + +package cpu + +import ( + "syscall" + "unsafe" +) + +type Errno = syscall.Errno + +// adapted from internal/cpu/cpu_arm64_darwin.go +func darwinSysctlEnabled(name []byte) bool { + out := int32(0) + nout := unsafe.Sizeof(out) + if ret := sysctlbyname(&name[0], (*byte)(unsafe.Pointer(&out)), &nout, nil, 0); ret != nil { + return false + } + return out > 0 +} + +//go:cgo_import_dynamic libc_sysctl sysctl "/usr/lib/libSystem.B.dylib" + +var libc_sysctlbyname_trampoline_addr uintptr + +// adapted from runtime/sys_darwin.go in the pattern of sysctl() above, as defined in x/sys/unix +func sysctlbyname(name *byte, old *byte, oldlen *uintptr, new *byte, newlen uintptr) error { + if _, _, err := syscall_syscall6( + libc_sysctlbyname_trampoline_addr, + uintptr(unsafe.Pointer(name)), + uintptr(unsafe.Pointer(old)), + uintptr(unsafe.Pointer(oldlen)), + uintptr(unsafe.Pointer(new)), + uintptr(newlen), + 0, + ); err != 0 { + return err + } + + return nil +} + +//go:cgo_import_dynamic libc_sysctlbyname sysctlbyname "/usr/lib/libSystem.B.dylib" + +// Implemented in the runtime package (runtime/sys_darwin.go) +func syscall_syscall6(fn, a1, a2, a3, a4, a5, a6 uintptr) (r1, r2 uintptr, err Errno) + +//go:linkname syscall_syscall6 syscall.syscall6 diff --git a/vendor/golang.org/x/sys/plan9/syscall_plan9.go b/vendor/golang.org/x/sys/plan9/syscall_plan9.go index d079d8116..761912237 100644 --- a/vendor/golang.org/x/sys/plan9/syscall_plan9.go +++ b/vendor/golang.org/x/sys/plan9/syscall_plan9.go @@ -19,13 +19,7 @@ import ( // A Note is a string describing a process note. // It implements the os.Signal interface. -type Note string - -func (n Note) Signal() {} - -func (n Note) String() string { - return string(n) -} +type Note = syscall.Note var ( Stdin = 0 diff --git a/vendor/golang.org/x/sys/unix/ztypes_linux.go b/vendor/golang.org/x/sys/unix/ztypes_linux.go index c1a467017..45476a73c 100644 --- a/vendor/golang.org/x/sys/unix/ztypes_linux.go +++ b/vendor/golang.org/x/sys/unix/ztypes_linux.go @@ -593,110 +593,115 @@ const ( ) const ( - NDA_UNSPEC = 0x0 - NDA_DST = 0x1 - NDA_LLADDR = 0x2 - NDA_CACHEINFO = 0x3 - NDA_PROBES = 0x4 - NDA_VLAN = 0x5 - NDA_PORT = 0x6 - NDA_VNI = 0x7 - NDA_IFINDEX = 0x8 - NDA_MASTER = 0x9 - NDA_LINK_NETNSID = 0xa - NDA_SRC_VNI = 0xb - NTF_USE = 0x1 - NTF_SELF = 0x2 - NTF_MASTER = 0x4 - NTF_PROXY = 0x8 - NTF_EXT_LEARNED = 0x10 - NTF_OFFLOADED = 0x20 - NTF_ROUTER = 0x80 - NUD_INCOMPLETE = 0x1 - NUD_REACHABLE = 0x2 - NUD_STALE = 0x4 - NUD_DELAY = 0x8 - NUD_PROBE = 0x10 - NUD_FAILED = 0x20 - NUD_NOARP = 0x40 - NUD_PERMANENT = 0x80 - NUD_NONE = 0x0 - IFA_UNSPEC = 0x0 - IFA_ADDRESS = 0x1 - IFA_LOCAL = 0x2 - IFA_LABEL = 0x3 - IFA_BROADCAST = 0x4 - IFA_ANYCAST = 0x5 - IFA_CACHEINFO = 0x6 - IFA_MULTICAST = 0x7 - IFA_FLAGS = 0x8 - IFA_RT_PRIORITY = 0x9 - IFA_TARGET_NETNSID = 0xa - IFAL_LABEL = 0x2 - IFAL_ADDRESS = 0x1 - RT_SCOPE_UNIVERSE = 0x0 - RT_SCOPE_SITE = 0xc8 - RT_SCOPE_LINK = 0xfd - RT_SCOPE_HOST = 0xfe - RT_SCOPE_NOWHERE = 0xff - RT_TABLE_UNSPEC = 0x0 - RT_TABLE_COMPAT = 0xfc - RT_TABLE_DEFAULT = 0xfd - RT_TABLE_MAIN = 0xfe - RT_TABLE_LOCAL = 0xff - RT_TABLE_MAX = 0xffffffff - RTA_UNSPEC = 0x0 - RTA_DST = 0x1 - RTA_SRC = 0x2 - RTA_IIF = 0x3 - RTA_OIF = 0x4 - RTA_GATEWAY = 0x5 - RTA_PRIORITY = 0x6 - RTA_PREFSRC = 0x7 - RTA_METRICS = 0x8 - RTA_MULTIPATH = 0x9 - RTA_FLOW = 0xb - RTA_CACHEINFO = 0xc - RTA_TABLE = 0xf - RTA_MARK = 0x10 - RTA_MFC_STATS = 0x11 - RTA_VIA = 0x12 - RTA_NEWDST = 0x13 - RTA_PREF = 0x14 - RTA_ENCAP_TYPE = 0x15 - RTA_ENCAP = 0x16 - RTA_EXPIRES = 0x17 - RTA_PAD = 0x18 - RTA_UID = 0x19 - RTA_TTL_PROPAGATE = 0x1a - RTA_IP_PROTO = 0x1b - RTA_SPORT = 0x1c - RTA_DPORT = 0x1d - RTN_UNSPEC = 0x0 - RTN_UNICAST = 0x1 - RTN_LOCAL = 0x2 - RTN_BROADCAST = 0x3 - RTN_ANYCAST = 0x4 - RTN_MULTICAST = 0x5 - RTN_BLACKHOLE = 0x6 - RTN_UNREACHABLE = 0x7 - RTN_PROHIBIT = 0x8 - RTN_THROW = 0x9 - RTN_NAT = 0xa - RTN_XRESOLVE = 0xb - SizeofNlMsghdr = 0x10 - SizeofNlMsgerr = 0x14 - SizeofRtGenmsg = 0x1 - SizeofNlAttr = 0x4 - SizeofRtAttr = 0x4 - SizeofIfInfomsg = 0x10 - SizeofIfAddrmsg = 0x8 - SizeofIfAddrlblmsg = 0xc - SizeofIfaCacheinfo = 0x10 - SizeofRtMsg = 0xc - SizeofRtNexthop = 0x8 - SizeofNdUseroptmsg = 0x10 - SizeofNdMsg = 0xc + NDA_UNSPEC = 0x0 + NDA_DST = 0x1 + NDA_LLADDR = 0x2 + NDA_CACHEINFO = 0x3 + NDA_PROBES = 0x4 + NDA_VLAN = 0x5 + NDA_PORT = 0x6 + NDA_VNI = 0x7 + NDA_IFINDEX = 0x8 + NDA_MASTER = 0x9 + NDA_LINK_NETNSID = 0xa + NDA_SRC_VNI = 0xb + NTF_USE = 0x1 + NTF_SELF = 0x2 + NTF_MASTER = 0x4 + NTF_PROXY = 0x8 + NTF_EXT_LEARNED = 0x10 + NTF_OFFLOADED = 0x20 + NTF_ROUTER = 0x80 + NUD_INCOMPLETE = 0x1 + NUD_REACHABLE = 0x2 + NUD_STALE = 0x4 + NUD_DELAY = 0x8 + NUD_PROBE = 0x10 + NUD_FAILED = 0x20 + NUD_NOARP = 0x40 + NUD_PERMANENT = 0x80 + NUD_NONE = 0x0 + IFA_UNSPEC = 0x0 + IFA_ADDRESS = 0x1 + IFA_LOCAL = 0x2 + IFA_LABEL = 0x3 + IFA_BROADCAST = 0x4 + IFA_ANYCAST = 0x5 + IFA_CACHEINFO = 0x6 + IFA_MULTICAST = 0x7 + IFA_FLAGS = 0x8 + IFA_RT_PRIORITY = 0x9 + IFA_TARGET_NETNSID = 0xa + IFAL_LABEL = 0x2 + IFAL_ADDRESS = 0x1 + RT_SCOPE_UNIVERSE = 0x0 + RT_SCOPE_SITE = 0xc8 + RT_SCOPE_LINK = 0xfd + RT_SCOPE_HOST = 0xfe + RT_SCOPE_NOWHERE = 0xff + RT_TABLE_UNSPEC = 0x0 + RT_TABLE_COMPAT = 0xfc + RT_TABLE_DEFAULT = 0xfd + RT_TABLE_MAIN = 0xfe + RT_TABLE_LOCAL = 0xff + RT_TABLE_MAX = 0xffffffff + RTA_UNSPEC = 0x0 + RTA_DST = 0x1 + RTA_SRC = 0x2 + RTA_IIF = 0x3 + RTA_OIF = 0x4 + RTA_GATEWAY = 0x5 + RTA_PRIORITY = 0x6 + RTA_PREFSRC = 0x7 + RTA_METRICS = 0x8 + RTA_MULTIPATH = 0x9 + RTA_FLOW = 0xb + RTA_CACHEINFO = 0xc + RTA_TABLE = 0xf + RTA_MARK = 0x10 + RTA_MFC_STATS = 0x11 + RTA_VIA = 0x12 + RTA_NEWDST = 0x13 + RTA_PREF = 0x14 + RTA_ENCAP_TYPE = 0x15 + RTA_ENCAP = 0x16 + RTA_EXPIRES = 0x17 + RTA_PAD = 0x18 + RTA_UID = 0x19 + RTA_TTL_PROPAGATE = 0x1a + RTA_IP_PROTO = 0x1b + RTA_SPORT = 0x1c + RTA_DPORT = 0x1d + RTN_UNSPEC = 0x0 + RTN_UNICAST = 0x1 + RTN_LOCAL = 0x2 + RTN_BROADCAST = 0x3 + RTN_ANYCAST = 0x4 + RTN_MULTICAST = 0x5 + RTN_BLACKHOLE = 0x6 + RTN_UNREACHABLE = 0x7 + RTN_PROHIBIT = 0x8 + RTN_THROW = 0x9 + RTN_NAT = 0xa + RTN_XRESOLVE = 0xb + PREFIX_UNSPEC = 0x0 + PREFIX_ADDRESS = 0x1 + PREFIX_CACHEINFO = 0x2 + SizeofNlMsghdr = 0x10 + SizeofNlMsgerr = 0x14 + SizeofRtGenmsg = 0x1 + SizeofNlAttr = 0x4 + SizeofRtAttr = 0x4 + SizeofIfInfomsg = 0x10 + SizeofPrefixmsg = 0xc + SizeofPrefixCacheinfo = 0x8 + SizeofIfAddrmsg = 0x8 + SizeofIfAddrlblmsg = 0xc + SizeofIfaCacheinfo = 0x10 + SizeofRtMsg = 0xc + SizeofRtNexthop = 0x8 + SizeofNdUseroptmsg = 0x10 + SizeofNdMsg = 0xc ) type NlMsghdr struct { @@ -735,6 +740,22 @@ type IfInfomsg struct { Change uint32 } +type Prefixmsg struct { + Family uint8 + Pad1 uint8 + Pad2 uint16 + Ifindex int32 + Type uint8 + Len uint8 + Flags uint8 + Pad3 uint8 +} + +type PrefixCacheinfo struct { + Preferred_time uint32 + Valid_time uint32 +} + type IfAddrmsg struct { Family uint8 Prefixlen uint8 diff --git a/vendor/golang.org/x/sys/windows/aliases.go b/vendor/golang.org/x/sys/windows/aliases.go index 16f90560a..96317966e 100644 --- a/vendor/golang.org/x/sys/windows/aliases.go +++ b/vendor/golang.org/x/sys/windows/aliases.go @@ -8,5 +8,6 @@ package windows import "syscall" +type Signal = syscall.Signal type Errno = syscall.Errno type SysProcAttr = syscall.SysProcAttr diff --git a/vendor/golang.org/x/sys/windows/dll_windows.go b/vendor/golang.org/x/sys/windows/dll_windows.go index 3ca814f54..1157b06d8 100644 --- a/vendor/golang.org/x/sys/windows/dll_windows.go +++ b/vendor/golang.org/x/sys/windows/dll_windows.go @@ -163,42 +163,7 @@ func (p *Proc) Addr() uintptr { // (according to the semantics of the specific function being called) before consulting // the error. The error will be guaranteed to contain windows.Errno. func (p *Proc) Call(a ...uintptr) (r1, r2 uintptr, lastErr error) { - switch len(a) { - case 0: - return syscall.Syscall(p.Addr(), uintptr(len(a)), 0, 0, 0) - case 1: - return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], 0, 0) - case 2: - return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], a[1], 0) - case 3: - return syscall.Syscall(p.Addr(), uintptr(len(a)), a[0], a[1], a[2]) - case 4: - return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], 0, 0) - case 5: - return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], 0) - case 6: - return syscall.Syscall6(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5]) - case 7: - return syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], 0, 0) - case 8: - return syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], 0) - case 9: - return syscall.Syscall9(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]) - case 10: - return syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], 0, 0) - case 11: - return syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], 0) - case 12: - return syscall.Syscall12(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11]) - case 13: - return syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], 0, 0) - case 14: - return syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], 0) - case 15: - return syscall.Syscall15(p.Addr(), uintptr(len(a)), a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14]) - default: - panic("Call " + p.Name + " with too many arguments " + itoa(len(a)) + ".") - } + return syscall.SyscallN(p.Addr(), a...) } // A LazyDLL implements access to a single DLL. diff --git a/vendor/golang.org/x/sys/windows/registry/key.go b/vendor/golang.org/x/sys/windows/registry/key.go index 39aeeb644..7cc6ff3af 100644 --- a/vendor/golang.org/x/sys/windows/registry/key.go +++ b/vendor/golang.org/x/sys/windows/registry/key.go @@ -198,7 +198,20 @@ type KeyInfo struct { // ModTime returns the key's last write time. func (ki *KeyInfo) ModTime() time.Time { - return time.Unix(0, ki.lastWriteTime.Nanoseconds()) + lastHigh, lastLow := ki.lastWriteTime.HighDateTime, ki.lastWriteTime.LowDateTime + // 100-nanosecond intervals since January 1, 1601 + hsec := uint64(lastHigh)<<32 + uint64(lastLow) + // Convert _before_ gauging; the nanosecond difference between Epoch (00:00:00 + // UTC, January 1, 1970) and Filetime's zero offset (January 1, 1601) is out + // of bounds for int64: -11644473600*1e7*1e2 < math.MinInt64 + sec := int64(hsec/1e7) - 11644473600 + nsec := int64(hsec%1e7) * 100 + return time.Unix(sec, nsec) +} + +// modTimeZero reports whether the key's last write time is zero. +func (ki *KeyInfo) modTimeZero() bool { + return ki.lastWriteTime.LowDateTime == 0 && ki.lastWriteTime.HighDateTime == 0 } // Stat retrieves information about the open key k. diff --git a/vendor/golang.org/x/sys/windows/security_windows.go b/vendor/golang.org/x/sys/windows/security_windows.go index a8b0364c7..6c955cea1 100644 --- a/vendor/golang.org/x/sys/windows/security_windows.go +++ b/vendor/golang.org/x/sys/windows/security_windows.go @@ -1438,13 +1438,17 @@ func GetSecurityInfo(handle Handle, objectType SE_OBJECT_TYPE, securityInformati } // GetNamedSecurityInfo queries the security information for a given named object and returns the self-relative security -// descriptor result on the Go heap. +// descriptor result on the Go heap. The security descriptor might be nil, even when err is nil, if the object exists +// but has no security descriptor. func GetNamedSecurityInfo(objectName string, objectType SE_OBJECT_TYPE, securityInformation SECURITY_INFORMATION) (sd *SECURITY_DESCRIPTOR, err error) { var winHeapSD *SECURITY_DESCRIPTOR err = getNamedSecurityInfo(objectName, objectType, securityInformation, nil, nil, nil, nil, &winHeapSD) if err != nil { return } + if winHeapSD == nil { + return nil, nil + } defer LocalFree(Handle(unsafe.Pointer(winHeapSD))) return winHeapSD.copySelfRelativeSecurityDescriptor(), nil } diff --git a/vendor/golang.org/x/sys/windows/syscall_windows.go b/vendor/golang.org/x/sys/windows/syscall_windows.go index 738a9f212..d76643658 100644 --- a/vendor/golang.org/x/sys/windows/syscall_windows.go +++ b/vendor/golang.org/x/sys/windows/syscall_windows.go @@ -1490,20 +1490,6 @@ func Getgid() (gid int) { return -1 } func Getegid() (egid int) { return -1 } func Getgroups() (gids []int, err error) { return nil, syscall.EWINDOWS } -type Signal int - -func (s Signal) Signal() {} - -func (s Signal) String() string { - if 0 <= s && int(s) < len(signals) { - str := signals[s] - if str != "" { - return str - } - } - return "signal " + itoa(int(s)) -} - func LoadCreateSymbolicLink() error { return procCreateSymbolicLinkW.Find() } diff --git a/vendor/golang.org/x/tools/go/analysis/analysis.go b/vendor/golang.org/x/tools/go/analysis/analysis.go index a7df4d1fe..786c29d55 100644 --- a/vendor/golang.org/x/tools/go/analysis/analysis.go +++ b/vendor/golang.org/x/tools/go/analysis/analysis.go @@ -11,6 +11,7 @@ import ( "go/token" "go/types" "reflect" + "time" ) // An Analyzer describes an analysis function and its options. @@ -250,7 +251,19 @@ type Fact interface { // A Module describes the module to which a package belongs. type Module struct { - Path string // module path - Version string // module version ("" if unknown, such as for workspace modules) - GoVersion string // go version used in module (e.g. "go1.22.0") + Path string // module path + Version string // module version ("" if unknown, such as for workspace modules) + Replace *Module // replaced by this module + Time *time.Time // time version was created + Main bool // is this the main module? + Indirect bool // is this module only an indirect dependency of main module? + Dir string // directory holding files for this module, if any + GoMod string // path to go.mod file used when loading this module, if any + GoVersion string // go version used in module (e.g. "go1.22.0") + Error *ModuleError // error loading module +} + +// ModuleError holds errors loading a module. +type ModuleError struct { + Err string // the error itself } diff --git a/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go b/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go index 28a5f6cd9..dfc431367 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/lostcancel/lostcancel.go @@ -16,7 +16,6 @@ import ( "golang.org/x/tools/go/ast/inspector" "golang.org/x/tools/go/cfg" "golang.org/x/tools/internal/analysis/analyzerutil" - "golang.org/x/tools/internal/astutil" "golang.org/x/tools/internal/typesinternal" ) @@ -84,7 +83,7 @@ func runFunc(pass *analysis.Pass, node ast.Node) { // {FuncDecl,FuncLit,CallExpr,SelectorExpr}. // Find the set of cancel vars to analyze. - astutil.PreorderStack(node, nil, func(n ast.Node, stack []ast.Node) bool { + ast.PreorderStack(node, nil, func(n ast.Node, stack []ast.Node) bool { if _, ok := n.(*ast.FuncLit); ok && len(stack) > 0 { return false // don't stray into nested functions } diff --git a/vendor/golang.org/x/tools/go/analysis/passes/modernize/atomic.go b/vendor/golang.org/x/tools/go/analysis/passes/modernize/atomic.go new file mode 100644 index 000000000..3293065c1 --- /dev/null +++ b/vendor/golang.org/x/tools/go/analysis/passes/modernize/atomic.go @@ -0,0 +1,255 @@ +// Copyright 2026 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package modernize + +import ( + "fmt" + "go/ast" + "go/token" + "go/types" + "strings" + + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/edge" + "golang.org/x/tools/go/ast/inspector" + "golang.org/x/tools/go/types/typeutil" + "golang.org/x/tools/internal/analysis/analyzerutil" + typeindexanalyzer "golang.org/x/tools/internal/analysis/typeindex" + "golang.org/x/tools/internal/astutil" + "golang.org/x/tools/internal/goplsexport" + "golang.org/x/tools/internal/refactor" + "golang.org/x/tools/internal/typesinternal" + "golang.org/x/tools/internal/typesinternal/typeindex" + "golang.org/x/tools/internal/versions" +) + +var atomicAnalyzer = &analysis.Analyzer{ + Name: "atomic", + Doc: analyzerutil.MustExtractDoc(doc, "atomic"), + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + typeindexanalyzer.Analyzer, + }, + Run: runAtomic, + URL: "https://pkg.go.dev/golang.org/x/tools/go/analysis/passes/modernize#atomic", +} + +func init() { + // Export to gopls until this is a published modernizer. + goplsexport.AtomicModernizer = atomicAnalyzer +} + +// TODO(mkalil): support the Pointer variants. +// Consider the following function signatures for pointer loading: +// func LoadPointer(addr *unsafe.Pointer) (val unsafe.Pointer) +// func (x *Pointer[T]) Load() *T +// Since the former uses *unsafe.Pointer while the latter uses *Pointer[T], +// we would need to determine the type T to apply the transformation, and there +// will be additional edits required to remove any *unsafe.Pointer casts. +// "LoadPointer", "StorePointer", "SwapPointer", "CompareAndSwapPointer" + +// sync/atomic functions of interest. Some added in go1.19, some added in go1.23. +var syncAtomicFuncs = []string{ + // Added in go1.19. + "AddInt32", "AddInt64", "AddUint32", "AddUint64", "AddUintptr", + "CompareAndSwapInt32", "CompareAndSwapInt64", "CompareAndSwapUint32", "CompareAndSwapUint64", "CompareAndSwapUintptr", + "LoadInt32", "LoadInt64", "LoadUint32", "LoadUint64", "LoadUintptr", + "StoreInt32", "StoreInt64", "StoreUint32", "StoreUint64", "StoreUintptr", + "SwapInt32", "SwapInt64", "SwapUint32", "SwapUint64", "SwapUintptr", + // Added in go1.23. + "AndInt32", "AndInt64", "AndUint32", "AndUint64", "AndUintptr", + "OrInt32", "OrInt64", "OrUint32", "OrUint64", "OrUintptr", +} + +func runAtomic(pass *analysis.Pass) (any, error) { + if !typesinternal.Imports(pass.Pkg, "sync/atomic") { + return nil, nil // doesn't directly import sync/atomic + } + + var ( + index = pass.ResultOf[typeindexanalyzer.Analyzer].(*typeindex.Index) + info = pass.TypesInfo + ) + + // Gather all candidate variables v appearing + // in calls to atomic.AddInt32(&v, ...) et al. + var ( + atomicPkg *types.Package + vars = make(map[*types.Var]string) // maps candidate vars v to the name of the call they appear in + ) + for _, funcName := range syncAtomicFuncs { + obj := index.Object("sync/atomic", funcName) + if obj == nil { + continue + } + atomicPkg = obj.Pkg() + for curCall := range index.Calls(obj) { + call := curCall.Node().(*ast.CallExpr) + if unary, ok := call.Args[0].(*ast.UnaryExpr); ok && unary.Op == token.AND { + var v *types.Var + switch x := unary.X.(type) { + case *ast.Ident: + v, _ = info.Uses[x].(*types.Var) + case *ast.SelectorExpr: + if seln, ok := info.Selections[x]; ok { + v, _ = seln.Obj().(*types.Var) + } + } + if v != nil && !v.Exported() { + // v must be a non-exported package or local var, or a struct field. + switch v.Kind() { + case types.RecvVar, types.ParamVar, types.ResultVar: + continue // fix would change func signature + } + vars[v] = funcName + } + } + } + } + + // Check that all uses of each candidate variable + // appear in calls of the form atomic.AddInt32(&v, ...). +nextvar: + for v, funcName := range vars { + var edits []analysis.TextEdit + fixFiles := make(map[*ast.File]bool) // unique files involved in the current fix + + // Check the form of the declaration: var v int or struct { v int } + def, ok := index.Def(v) + if !ok { + continue + } + var ( + typ ast.Expr + names []*ast.Ident + ) + switch parent := def.Parent().Node().(type) { + case *ast.Field: // struct { v int } + names = parent.Names + typ = parent.Type + case *ast.ValueSpec: // var v int + if len(parent.Values) > 0 { + // e.g. var v int = 5 + // skip because rewriting as `var v atomic.Int32 = 5` is invalid + continue + } + names = parent.Names + typ = parent.Type + } + if len(names) != 1 || typ == nil { + continue // v is not the sole var declared here (e.g. var x, y int32); or no explicit type + } + oldType := info.TypeOf(typ) // e.g. "int32" + newType := strings.Title(oldType.Underlying().String()) // e.g. "Int32" + + // Get package prefix to avoid shadowing. + file := astutil.EnclosingFile(def) + pkgPrefix, impEdits := refactor.AddImport(pass.TypesInfo, file, "atomic", "sync/atomic", "", def.Node().Pos()) + if len(impEdits) > 0 { + panic("unexpected import edits") // atomic PkgName should be in scope already + } + // Edit the type. + // + // var v int32 + // ------------ + // var v atomic.Int32 + edits = append(edits, analysis.TextEdit{ + Pos: typ.Pos(), + End: typ.End(), + NewText: fmt.Appendf(nil, "%s%s", pkgPrefix, newType), + }) + fixFiles[file] = true + + // Each valid use is an Ident v or Selector expr.v within an atomic.F(&...) call. + var validUses []inspector.Cursor + for cur := range index.Uses(v) { + if v.IsField() && cur.ParentEdgeKind() == edge.KeyValueExpr_Key { + continue nextvar // we cannot fix initial an value assignment T{v: 1} + } + if cur.ParentEdgeKind() == edge.SelectorExpr_Sel { + cur = cur.Parent() // ascend from v to expr.v + } + // Inv: cur is the l-value expression denoting v. + // v must appear beneath atomic.AddInt32(&v, ...) call. + valid := false + if cur.ParentEdgeKind() == edge.UnaryExpr_X && + cur.Parent().Node().(*ast.UnaryExpr).Op == token.AND { + if ek, idx := cur.Parent().ParentEdge(); ek == edge.CallExpr_Args && idx == 0 { + curCall := cur.Parent().Parent() + call := curCall.Node().(*ast.CallExpr) + if fn, ok := typeutil.Callee(info, call).(*types.Func); ok && fn.Pkg() == atomicPkg { + valid = true + } + } + } + + if !valid { + // More complex case: reject candidate. + // + // For example, cur may be an unsynchronized load (e.g. v == 0). To + // avoid a type conversion error, we'd have to rewrite this as + // v.Load(). However, this is an invalid rewrite: if the program is + // mixing atomic operations with unsynchronized reads, the author + // might have accidentally introduced a data race and the suggested + // fix could obscure the mistake. Or, if the usage is intentional, + // rewriting may result in a behavior change. + continue nextvar + } + validUses = append(validUses, cur) + } + + for _, cur := range validUses { + vexpr := cur.Node() + call := cur.Parent().Parent().Node().(*ast.CallExpr) + fn := typeutil.Callee(info, call).(*types.Func) + // atomic.AddInt32(&v, ...) + // ----------------- ----- + // v.Add(...) + after := vexpr.End() // LoadInt32(&v⁁) + if len(call.Args) > 1 { + after = call.Args[1].Pos() // AddInt32(&v, ⁁...) + } + verb := strings.TrimSuffix(fn.Name(), newType) // "AddInt32" => "Add" + edits = append(edits, []analysis.TextEdit{ + { + Pos: call.Pos(), + End: vexpr.Pos(), + }, + { + Pos: vexpr.End(), + End: after, + NewText: fmt.Appendf(nil, ".%s(", verb), + }, + }...) + fixFiles[astutil.EnclosingFile(cur)] = true + } + + // Check minimum Go version: go1.19, or 1.23 for the And/Or functions. + if !(analyzerutil.FileUsesGoVersion(pass, file, versions.Go1_19) || + analyzerutil.FileUsesGoVersion(pass, file, versions.Go1_23) && + (strings.HasPrefix(funcName, "And") || strings.HasPrefix(funcName, "Or"))) { + continue + } + + // Skip if v is not local and the package has ignored files as it may be + // an incomplete transformation. + if !isLocal(v) && len(pass.IgnoredFiles) > 0 { + continue + } + + pass.Report(analysis.Diagnostic{ + Pos: names[0].Pos(), + End: typ.End(), + Message: fmt.Sprintf("var %s %s may be simplified using atomic.%s", v.Name(), oldType, newType), + SuggestedFixes: []analysis.SuggestedFix{{ + Message: fmt.Sprintf("Replace %s by atomic.%s", oldType, newType), + TextEdits: edits, + }}, + }) + } + + return nil, nil +} diff --git a/vendor/golang.org/x/tools/go/analysis/passes/modernize/doc.go b/vendor/golang.org/x/tools/go/analysis/passes/modernize/doc.go index 0425faf8d..826f9f49e 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/modernize/doc.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/modernize/doc.go @@ -65,6 +65,26 @@ This analyzer is currently disabled by default as the transformation does not preserve the nilness of the base slice in all cases; see https://go.dev/issue/73557. +# Analyzer atomic + +atomic: replace basic types in sync/atomic calls with atomic types + +The atomic analyzer suggests replacing the primitive sync/atomic functions with +the strongly typed atomic wrapper types introduced in Go1.19 (e.g. +atomic.Int32). For example, + + var x int32 + atomic.AddInt32(&x, 1) + +would become + + var x atomic.Int32 + x.Add(1) + +The atomic types are safer because they don't allow non-atomic access, which is +a common source of bugs. These types also resolve memory alignment issues that +plagued the old atomic functions on 32-bit architectures. + # Analyzer bloop bloop: replace for-range over b.N with b.Loop @@ -263,11 +283,15 @@ is known at compile time, for example: reflect.TypeOf(uint32(0)) -> reflect.TypeFor[uint32]() reflect.TypeOf((*ast.File)(nil)) -> reflect.TypeFor[*ast.File]() -It also offers a fix to simplify the construction below, which uses +It also offers a fix to simplify the constructions below, which use reflect.TypeOf to return the runtime type for an interface type, reflect.TypeOf((*io.Reader)(nil)).Elem() +or: + + reflect.TypeOf([]io.Reader(nil)).Elem() + to: reflect.TypeFor[io.Reader]() @@ -460,14 +484,15 @@ is replaced by: This avoids quadratic memory allocation and improves performance. -The analyzer requires that all references to s except the final one +The analyzer requires that all references to s before the final uses are += operations. To avoid warning about trivial cases, at least one must appear within a loop. The variable s must be a local variable, not a global or parameter. -The sole use of the finished string must be the last reference to the -variable s. (It may appear within an intervening loop or function literal, -since even s.String() is called repeatedly, it does not allocate memory.) +All uses of the finished string must come after the last += operation. +Each such use will be replaced by a call to strings.Builder's String method. +(These may appear within an intervening loop or function literal, since even +if s.String() is called repeatedly, it does not allocate memory.) Often the addend is a call to fmt.Sprintf, as in this example: diff --git a/vendor/golang.org/x/tools/go/analysis/passes/modernize/errorsastype.go b/vendor/golang.org/x/tools/go/analysis/passes/modernize/errorsastype.go index 6e1070fd1..8603d5471 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/modernize/errorsastype.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/modernize/errorsastype.go @@ -125,22 +125,11 @@ func errorsastype(pass *analysis.Pass) (any, error) { errtype := types.TypeString(v.Type(), qual) // Choose a name for the "ok" variable. - // TODO(adonovan): this pattern also appears in stditerators, - // and is wanted elsewhere; factor. - okName := "ok" - if okVar := lookup(info, curCall, "ok"); okVar != nil { - // The name 'ok' is already declared, but - // don't choose a fresh name unless okVar - // is also used within the if-statement. - curIf := curCall.Parent() - for curUse := range index.Uses(okVar) { - if curIf.Contains(curUse) { - scope := info.Scopes[curIf.Node().(*ast.IfStmt)] - okName = refactor.FreshName(scope, v.Pos(), "ok") - break - } - } - } + // We generate a new name only if 'ok' is already declared at + // curCall and it also used within the if-statement. + curIf := curCall.Parent() + ifScope := info.Scopes[curIf.Node().(*ast.IfStmt)] + okName := freshName(info, index, ifScope, v.Pos(), curCall, curIf, token.NoPos, "ok") pass.Report(analysis.Diagnostic{ Pos: call.Fun.Pos(), diff --git a/vendor/golang.org/x/tools/go/analysis/passes/modernize/fmtappendf.go b/vendor/golang.org/x/tools/go/analysis/passes/modernize/fmtappendf.go index 389f70346..821065413 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/modernize/fmtappendf.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/modernize/fmtappendf.go @@ -7,6 +7,7 @@ package modernize import ( "fmt" "go/ast" + "go/constant" "go/types" "strings" @@ -16,6 +17,7 @@ import ( "golang.org/x/tools/internal/analysis/analyzerutil" typeindexanalyzer "golang.org/x/tools/internal/analysis/typeindex" "golang.org/x/tools/internal/astutil" + "golang.org/x/tools/internal/fmtstr" "golang.org/x/tools/internal/typesinternal/typeindex" "golang.org/x/tools/internal/versions" ) @@ -45,10 +47,24 @@ func fmtappendf(pass *analysis.Pass) (any, error) { if ek, idx := curCall.ParentEdge(); ek == edge.CallExpr_Args && idx == 0 { // Is parent a T(fmt.SprintX(...)) conversion? conv := curCall.Parent().Node().(*ast.CallExpr) - tv := pass.TypesInfo.Types[conv.Fun] - if tv.IsType() && types.Identical(tv.Type, byteSliceType) && - analyzerutil.FileUsesGoVersion(pass, astutil.EnclosingFile(curCall), versions.Go1_19) { + info := pass.TypesInfo + tv := info.Types[conv.Fun] + if tv.IsType() && types.Identical(tv.Type, byteSliceType) { // Have: []byte(fmt.SprintX(...)) + if len(call.Args) == 0 { + continue + } + // fmt.Sprint(f) and fmt.Append(f) have different nil semantics + // when the format produces an empty string: + // []byte(fmt.Sprintf("")) returns an empty but non-nil + // []byte{}, while fmt.Appendf(nil, "") returns nil) so we + // should skip these cases. + if fn.Name() == "Sprint" || fn.Name() == "Sprintf" { + format := info.Types[call.Args[0]].Value + if format != nil && mayFormatEmpty(constant.StringVal(format)) { + continue + } + } // Find "Sprint" identifier. var id *ast.Ident @@ -62,13 +78,18 @@ func fmtappendf(pass *analysis.Pass) (any, error) { old, new := fn.Name(), strings.Replace(fn.Name(), "Sprint", "Append", 1) edits := []analysis.TextEdit{ { - // delete "[]byte(" + // Delete "[]byte(", including any spaces before the first argument. Pos: conv.Pos(), - End: conv.Lparen + 1, + End: conv.Args[0].Pos(), // always exactly one argument in a valid byte slice conversion }, { - // remove ")" - Pos: conv.Rparen, + // Delete ")", including any non-args (space or + // commas) that come before the right parenthesis. + // Leaving an extra comma here produces invalid + // code. (See golang/go#74709) + // Unfortunately, this and the edit above may result + // in deleting some comments. + Pos: conv.Args[0].End(), End: conv.Rparen + 1, }, { @@ -81,19 +102,8 @@ func fmtappendf(pass *analysis.Pass) (any, error) { NewText: []byte("nil, "), }, } - if len(conv.Args) == 1 { - arg := conv.Args[0] - // Determine if we have T(fmt.SprintX(...)). If so, delete the non-args - // that come before the right parenthesis. Leaving an - // extra comma here produces invalid code. (See - // golang/go#74709) - if arg.End() < conv.Rparen { - edits = append(edits, analysis.TextEdit{ - Pos: arg.End(), - End: conv.Rparen, - }) - } + if !analyzerutil.FileUsesGoVersion(pass, astutil.EnclosingFile(curCall), versions.Go1_19) { + continue } pass.Report(analysis.Diagnostic{ Pos: conv.Pos(), @@ -110,3 +120,43 @@ func fmtappendf(pass *analysis.Pass) (any, error) { } return nil, nil } + +// mayFormatEmpty reports whether fmt.Sprintf might produce an empty string. +// It returns false in the following two cases: +// 1. formatStr contains non-operation characters. +// 2. formatStr contains formatting verbs besides s, v, x, X (verbs which may +// produce empty results) +// +// In all other cases it returns true. +func mayFormatEmpty(formatStr string) bool { + if formatStr == "" { + return true + } + operations, err := fmtstr.Parse(formatStr, 0) + if err != nil { + // If formatStr is malformed, the printf analyzer will report a + // diagnostic, so we can ignore this error. + // Calling Parse on a string without % formatters also returns an error, + // in which case we can safely return false. + return false + } + totalOpsLen := 0 + for _, op := range operations { + totalOpsLen += len(op.Text) + if !strings.ContainsRune("svxX", rune(op.Verb.Verb)) && op.Prec.Fixed != 0 { + // A non [s, v, x, X] formatter with non-zero precision cannot + // produce an empty string. + return false + } + } + // If the format string contains non-operation characters, it cannot produce + // the empty string. + if totalOpsLen != len(formatStr) { + return false + } + // If we get here, it means that all formatting verbs are %s, %v, %x, %X, + // and there are no additional non-operation characters. We conservatively + // report that this may format as an empty string, ignoring uses of + // precision and the values of the formatter args. + return true +} diff --git a/vendor/golang.org/x/tools/go/analysis/passes/modernize/minmax.go b/vendor/golang.org/x/tools/go/analysis/passes/modernize/minmax.go index a77ed8389..b4b8dba3d 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/modernize/minmax.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/modernize/minmax.go @@ -147,6 +147,13 @@ func minmax(pass *analysis.Pass) (any, error) { lhs0 := fassign.Lhs[0] rhs0 := fassign.Rhs[0] + // If the assignment occurs within a select + // comms clause (like "case lhs0 := <-rhs0:"), + // there's no way of rewriting it into a min/max call. + if prev.ParentEdgeKind() == edge.CommClause_Comm { + return + } + if astutil.EqualSyntax(lhs, lhs0) { if astutil.EqualSyntax(rhs, a) && (astutil.EqualSyntax(rhs0, b) || astutil.EqualSyntax(lhs0, b)) { sign = +sign diff --git a/vendor/golang.org/x/tools/go/analysis/passes/modernize/modernize.go b/vendor/golang.org/x/tools/go/analysis/passes/modernize/modernize.go index ef28a40d1..0c388e96b 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/modernize/modernize.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/modernize/modernize.go @@ -20,6 +20,8 @@ import ( "golang.org/x/tools/go/ast/edge" "golang.org/x/tools/go/ast/inspector" "golang.org/x/tools/internal/analysis/analyzerutil" + "golang.org/x/tools/internal/refactor" + "golang.org/x/tools/internal/typesinternal/typeindex" "golang.org/x/tools/internal/moreiters" "golang.org/x/tools/internal/packagepath" @@ -33,6 +35,7 @@ var doc string // Suite lists all modernize analyzers. var Suite = []*analysis.Analyzer{ AnyAnalyzer, + atomicAnalyzer, // AppendClippedAnalyzer, // not nil-preserving! // BLoopAnalyzer, // may skew benchmark results, see golang/go#74967 FmtAppendfAnalyzer, @@ -144,3 +147,37 @@ func lookup(info *types.Info, cur inspector.Cursor, name string) types.Object { } func first[T any](x T, _ any) T { return x } + +// freshName returns a fresh name at the given pos and scope based on preferredName. +// It generates a new name using refactor.FreshName only if: +// (a) the preferred name is already defined at definedCur, and +// (b) there are references to it from within usedCur. +// If useAfterPos.IsValid(), the references must be after +// useAfterPos within usedCur in order to warrant a fresh name. +// Otherwise, it returns preferredName, since shadowing is valid in this case. +// (declaredCur and usedCur may be identical in some use cases). +func freshName(info *types.Info, index *typeindex.Index, scope *types.Scope, pos token.Pos, defCur inspector.Cursor, useCur inspector.Cursor, useAfterPos token.Pos, preferredName string) string { + obj := lookup(info, defCur, preferredName) + if obj == nil { + // preferredName has not been declared here. + return preferredName + } + for use := range index.Uses(obj) { + if useCur.Contains(use) && use.Node().Pos() >= useAfterPos { + return refactor.FreshName(scope, pos, preferredName) + } + } + // Name is taken but not used in the given block; shadowing is acceptable. + return preferredName +} + +// isLocal reports whether obj is local to some function. +// Precondition: not a struct field or interface method. +func isLocal(obj types.Object) bool { + // [... 5=stmt 4=func 3=file 2=pkg 1=universe] + var depth int + for scope := obj.Parent(); scope != nil; scope = scope.Parent() { + depth++ + } + return depth >= 4 +} diff --git a/vendor/golang.org/x/tools/go/analysis/passes/modernize/rangeint.go b/vendor/golang.org/x/tools/go/analysis/passes/modernize/rangeint.go index 257f9e9ec..03c7fd4f3 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/modernize/rangeint.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/modernize/rangeint.go @@ -18,7 +18,6 @@ import ( "golang.org/x/tools/internal/analysis/analyzerutil" typeindexanalyzer "golang.org/x/tools/internal/analysis/typeindex" "golang.org/x/tools/internal/astutil" - "golang.org/x/tools/internal/moreiters" "golang.org/x/tools/internal/typesinternal" "golang.org/x/tools/internal/typesinternal/typeindex" "golang.org/x/tools/internal/versions" @@ -142,15 +141,12 @@ func rangeint(pass *analysis.Pass) (any, error) { // Find references to i within the loop body. v := info.ObjectOf(index).(*types.Var) - // TODO(adonovan): use go1.25 v.Kind() == types.PackageVar - if typesinternal.IsPackageLevel(v) { + switch v.Kind() { + case types.PackageVar: continue nextLoop - } - - // If v is a named result, it is implicitly - // used after the loop (go.dev/issue/76880). - // TODO(adonovan): use go1.25 v.Kind() == types.ResultVar. - if moreiters.Contains(enclosingSignature(curLoop, info).Results().Variables(), v) { + case types.ResultVar: + // If v is a named result, it is implicitly + // used after the loop (go.dev/issue/76880). continue nextLoop } @@ -230,7 +226,7 @@ func rangeint(pass *analysis.Pass) (any, error) { // such as "const limit = 1e3", its effective type may // differ between the two forms. // In a for loop, it must be comparable with int i, - // for i := 0; i < limit; i++ + // for i := 0; i < limit; i++ {} // but in a range loop it would become a float, // for i := range limit {} // which is a type error. We need to convert it to int @@ -249,9 +245,24 @@ func rangeint(pass *analysis.Pass) (any, error) { beforeLimit, afterLimit = fmt.Sprintf("%s(", types.TypeString(tVar, qual)), ")" info2 := &types.Info{Types: make(map[ast.Expr]types.TypeAndValue)} if types.CheckExpr(pass.Fset, pass.Pkg, limit.Pos(), limit, info2) == nil { - tLimit := types.Default(info2.TypeOf(limit)) - if types.AssignableTo(tLimit, tVar) { - beforeLimit, afterLimit = "", "" + tLimit := info2.TypeOf(limit) + // Eliminate conversion when safe. + // + // Redundant conversions are not only unsightly but may in some cases cause + // architecture-specific types (e.g. syscall.Timespec.Nsec) to be inserted + // into otherwise portable files. + // + // The operand must have an integer type (not, say, '1e6') + // even when assigning to an existing integer variable. + if isInteger(tLimit) { + // When declaring a new var from an untyped limit, + // the limit's default type is what matters. + if init.Tok != token.ASSIGN { + tLimit = types.Default(tLimit) + } + if types.AssignableTo(tLimit, tVar) { + beforeLimit, afterLimit = "", "" + } } } } diff --git a/vendor/golang.org/x/tools/go/analysis/passes/modernize/reflect.go b/vendor/golang.org/x/tools/go/analysis/passes/modernize/reflect.go index 1dca2be37..1e9a54bd5 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/modernize/reflect.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/modernize/reflect.go @@ -47,6 +47,14 @@ func reflecttypefor(pass *analysis.Pass) (any, error) { // Have: reflect.TypeOf(expr) expr := call.Args[0] + + // reflect.TypeFor cannot be instantiated with an untyped nil. + // We use type information rather than checking the identifier name + // to correctly handle edge cases where "nil" is shadowed (e.g. nil := "nil"). + if info.Types[expr].IsNil() { + continue + } + if !typesinternal.NoEffects(info, expr) { continue // don't eliminate operand: may have effects } @@ -54,24 +62,30 @@ func reflecttypefor(pass *analysis.Pass) (any, error) { t := info.TypeOf(expr) var edits []analysis.TextEdit - // Special case for TypeOf((*T)(nil)).Elem(), - // needed when T is an interface type. + // Special cases for TypeOf((*T)(nil)).Elem(), and + // TypeOf([]T(nil)).Elem(), needed when T is an interface type. if curCall.ParentEdgeKind() == edge.SelectorExpr_X { curSel := unparenEnclosing(curCall).Parent() if curSel.ParentEdgeKind() == edge.CallExpr_Fun { - call2 := unparenEnclosing(curSel).Parent().Node().(*ast.CallExpr) + call2 := unparenEnclosing(curSel).Parent().Node().(*ast.CallExpr) // potentially .Elem() obj := typeutil.Callee(info, call2) if typesinternal.IsMethodNamed(obj, "reflect", "Type", "Elem") { - if ptr, ok := t.(*types.Pointer); ok { + // reflect.TypeOf(expr).Elem() + // ------- + // reflect.TypeOf(expr) + removeElem := []analysis.TextEdit{{ + Pos: call.End(), + End: call2.End(), + }} + switch typ := t.(type) { + case *types.Pointer: // Have: TypeOf(expr).Elem() where expr : *T - t = ptr.Elem() - // reflect.TypeOf(expr).Elem() - // ------- - // reflect.TypeOf(expr) - edits = []analysis.TextEdit{{ - Pos: call.End(), - End: call2.End(), - }} + t = typ.Elem() + edits = removeElem + case *types.Slice: + // Have: TypeOf(expr).Elem() where expr : []T + t = typ.Elem() + edits = removeElem } } } diff --git a/vendor/golang.org/x/tools/go/analysis/passes/modernize/slicescontains.go b/vendor/golang.org/x/tools/go/analysis/passes/modernize/slicescontains.go index 3b3268526..19e597831 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/modernize/slicescontains.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/modernize/slicescontains.go @@ -231,7 +231,9 @@ func slicescontains(pass *analysis.Pass) (any, error) { // that might affected by melting down the loop. // // TODO(adonovan): relax check by analyzing branch target. + numBodyStmts := 0 for curBodyStmt := range curBody.Children() { + numBodyStmts += 1 if curBodyStmt != curLastStmt { for range curBodyStmt.Preorder((*ast.BranchStmt)(nil), (*ast.ReturnStmt)(nil)) { return @@ -292,7 +294,16 @@ func slicescontains(pass *analysis.Pass) (any, error) { case *ast.BranchStmt: if lastStmt.Tok == token.BREAK && lastStmt.Label == nil { // unlabeled break // Have: for ... { if ... { stmts; break } } - + if numBodyStmts == 1 { + // If the only stmt in the body is an unlabeled "break" that + // will get deleted in the fix, don't suggest a fix, as it + // produces confusing code: + // if slices.Contains(slice, f) {} + // Explicitly discarding the result isn't much better: + // _ = slices.Contains(slice, f) // just for effects + // See https://go.dev/issue/77677. + return + } var prevStmt ast.Stmt // previous statement to range (if any) if curPrev, ok := curRange.PrevSibling(); ok { // If the RangeStmt's previous sibling is a Stmt, diff --git a/vendor/golang.org/x/tools/go/analysis/passes/modernize/stditerators.go b/vendor/golang.org/x/tools/go/analysis/passes/modernize/stditerators.go index 1d1a9ca3b..86e1c8fd4 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/modernize/stditerators.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/modernize/stditerators.go @@ -18,7 +18,6 @@ import ( typeindexanalyzer "golang.org/x/tools/internal/analysis/typeindex" "golang.org/x/tools/internal/astutil" "golang.org/x/tools/internal/goplsexport" - "golang.org/x/tools/internal/refactor" "golang.org/x/tools/internal/stdlib" "golang.org/x/tools/internal/typesinternal/typeindex" ) @@ -182,22 +181,9 @@ func stditerators(pass *analysis.Pass) (any, error) { } loop := curBody.Parent().Node() - - // Choose a fresh name only if - // (a) the preferred name is already declared here, and - // (b) there are references to it from the loop body. - // TODO(adonovan): this pattern also appears in errorsastype, - // and is wanted elsewhere; factor. - name := row.elemname - if v := lookup(info, curBody, name); v != nil { - // is it free in body? - for curUse := range index.Uses(v) { - if curBody.Contains(curUse) { - name = refactor.FreshName(info.Scopes[loop], loop.Pos(), name) - break - } - } - } + // We generate a new name only if the preferred name is already declared here + // and is used within the loop body. + name := freshName(info, index, info.Scopes[loop], loop.Pos(), curBody, curBody, token.NoPos, row.elemname) return name, nil } diff --git a/vendor/golang.org/x/tools/go/analysis/passes/modernize/stringsbuilder.go b/vendor/golang.org/x/tools/go/analysis/passes/modernize/stringsbuilder.go index a6c2c1f86..e89baa9b0 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/modernize/stringsbuilder.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/modernize/stringsbuilder.go @@ -22,7 +22,6 @@ import ( typeindexanalyzer "golang.org/x/tools/internal/analysis/typeindex" "golang.org/x/tools/internal/astutil" "golang.org/x/tools/internal/refactor" - "golang.org/x/tools/internal/typesinternal" "golang.org/x/tools/internal/typesinternal/typeindex" ) @@ -57,7 +56,7 @@ func stringsbuilder(pass *analysis.Pass) (any, error) { assign := curAssign.Node().(*ast.AssignStmt) if assign.Tok == token.ADD_ASSIGN && is[*ast.Ident](assign.Lhs[0]) { if v, ok := pass.TypesInfo.Uses[assign.Lhs[0].(*ast.Ident)].(*types.Var); ok && - !typesinternal.IsPackageLevel(v) && // TODO(adonovan): in go1.25, use v.Kind() == types.LocalVar && + v.Kind() == types.LocalVar && types.Identical(v.Type(), builtinString.Type()) { candidates[v] = true } @@ -254,8 +253,8 @@ nextcand: // var s string // for ... { s += expr } // - // - The final use of s must be as an rvalue (e.g. use(s), not &s). - // This will become s.String(). + // - All uses of s after the last += must be rvalue uses (e.g. use(s), not &s). + // Each of these will become s.String(). // // Perhaps surprisingly, it is fine for there to be an // intervening loop or lambda w.r.t. the declaration of s: @@ -270,7 +269,7 @@ nextcand: var ( numLoopAssigns int // number of += assignments within a loop loopAssign *ast.AssignStmt // first += assignment within a loop - seenRvalueUse bool // => we've seen the sole final use of s as an rvalue + seenRvalueUse bool // => we've seen at least one rvalue use of s ) for curUse := range index.Uses(v) { // Strip enclosing parens around Ident. @@ -280,11 +279,6 @@ nextcand: ek = curUse.ParentEdgeKind() } - // The rvalueUse must be the lexically last use. - if seenRvalueUse { - continue nextcand - } - // intervening reports whether cur has an ancestor of // one of the given types that is within the scope of v. intervening := func(types ...ast.Node) bool { @@ -297,6 +291,11 @@ nextcand: } if ek == edge.AssignStmt_Lhs { + // After an rvalue use, no more assignments are allowed. + if seenRvalueUse { + continue nextcand + } + assign := curUse.Parent().Node().(*ast.AssignStmt) if assign.Tok != token.ADD_ASSIGN { continue nextcand @@ -317,9 +316,9 @@ nextcand: // ------------- - // s.WriteString(expr) edits = append(edits, []analysis.TextEdit{ - // replace += with .WriteString() + // replace " += " with ".WriteString(" { - Pos: assign.TokPos, + Pos: assign.Lhs[0].End(), End: assign.Rhs[0].Pos(), NewText: []byte(".WriteString("), }, diff --git a/vendor/golang.org/x/tools/go/analysis/passes/modernize/stringscut.go b/vendor/golang.org/x/tools/go/analysis/passes/modernize/stringscut.go index f963b547b..6192c56fa 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/modernize/stringscut.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/modernize/stringscut.go @@ -22,7 +22,7 @@ import ( typeindexanalyzer "golang.org/x/tools/internal/analysis/typeindex" "golang.org/x/tools/internal/astutil" "golang.org/x/tools/internal/goplsexport" - "golang.org/x/tools/internal/refactor" + "golang.org/x/tools/internal/moreiters" "golang.org/x/tools/internal/typesinternal" "golang.org/x/tools/internal/typesinternal/typeindex" "golang.org/x/tools/internal/versions" @@ -124,6 +124,8 @@ func stringscut(pass *analysis.Pass) (any, error) { bytesIndexByte = index.Object("bytes", "IndexByte") ) + scopeFixCount := make(map[*types.Scope]int) // the number of times we have offered a fix within a given scope in the current pass + for _, obj := range []types.Object{ stringsIndex, stringsIndexByte, @@ -183,7 +185,7 @@ func stringscut(pass *analysis.Pass) (any, error) { // len(substr)]), then we can replace the call to Index() // with a call to Cut() and use the returned ok, before, // and after variables accordingly. - negative, nonnegative, beforeSlice, afterSlice := checkIdxUses(pass.TypesInfo, index.Uses(iObj), s, substr) + negative, nonnegative, beforeSlice, afterSlice := checkIdxUses(pass.TypesInfo, index.Uses(iObj), s, substr, iObj) // Either there are no uses of before, after, or ok, or some use // of i does not match our criteria - don't suggest a fix. @@ -194,14 +196,48 @@ func stringscut(pass *analysis.Pass) (any, error) { // If the only uses are ok and !ok, don't suggest a Cut() fix - these should be using Contains() isContains := (len(negative) > 0 || len(nonnegative) > 0) && len(beforeSlice) == 0 && len(afterSlice) == 0 + enclosingBlock, ok := moreiters.First(curCall.Enclosing((*ast.BlockStmt)(nil))) + if !ok { + continue + } scope := iObj.Parent() - var ( - // TODO(adonovan): avoid FreshName when not needed; see errorsastype. - okVarName = refactor.FreshName(scope, iIdent.Pos(), "ok") - beforeVarName = refactor.FreshName(scope, iIdent.Pos(), "before") - afterVarName = refactor.FreshName(scope, iIdent.Pos(), "after") - foundVarName = refactor.FreshName(scope, iIdent.Pos(), "found") // for Contains() - ) + // Generate fresh names for ok, before, after, found, but only if + // they are defined by the end of the enclosing block and used + // within the enclosing block after the Index call. We need a Cursor + // for the end of the enclosing block, but we can't just find the + // Cursor at scope.End() because it corresponds to the entire + // enclosingBlock. Instead, get the last child of the enclosing + // block. + lastStmtCur, _ := enclosingBlock.LastChild() + lastStmt := lastStmtCur.Node() + + fresh := func(preferred string) string { + return freshName(info, index, scope, lastStmt.End(), lastStmtCur, enclosingBlock, iIdent.Pos(), preferred) + } + + var okVarName, beforeVarName, afterVarName, foundVarName string + if isContains { + foundVarName = fresh("found") + } else { + okVarName = fresh("ok") + beforeVarName = fresh("before") + afterVarName = fresh("after") + } + + // If we are already suggesting a fix within the index's scope, we + // must get fresh names for before, after and ok. + // This is a specific symptom of the general problem that analyzers + // can generate conflicting fixes. + if scopeFixCount[scope] > 0 { + suffix := scopeFixCount[scope] - 1 // start at 0 + if isContains { + foundVarName = fresh(fmt.Sprintf("%s%d", foundVarName, suffix)) + } else { + okVarName = fresh(fmt.Sprintf("%s%d", okVarName, suffix)) + beforeVarName = fresh(fmt.Sprintf("%s%d", beforeVarName, suffix)) + afterVarName = fresh(fmt.Sprintf("%s%d", afterVarName, suffix)) + } + } // If there will be no uses of ok, before, or after, use the // blank identifier instead. @@ -313,6 +349,7 @@ func stringscut(pass *analysis.Pass) (any, error) { }...) } } + scopeFixCount[scope]++ pass.Report(analysis.Diagnostic{ Pos: indexCall.Fun.Pos(), End: indexCall.Fun.End(), @@ -374,14 +411,31 @@ func indexArgValid(info *types.Info, index *typeindex.Index, expr ast.Expr, afte // 2. nonnegative - a condition equivalent to i >= 0 // 3. beforeSlice - a slice of `s` that matches either s[:i], s[0:i] // 4. afterSlice - a slice of `s` that matches one of: s[i+len(substr):], s[len(substr) + i:], s[i + const], s[k + i] (where k = len(substr)) -func checkIdxUses(info *types.Info, uses iter.Seq[inspector.Cursor], s, substr ast.Expr) (negative, nonnegative, beforeSlice, afterSlice []ast.Expr) { +// +// Additionally, all beforeSlice and afterSlice uses must be dominated by a +// nonnegative guard on i (i.e., inside the body of an if whose condition +// checks i >= 0, or in the else of a negative check, or after an +// early-return negative check). This ensures that the rewrite from +// s[i+len(sep):] to "after" preserves semantics, since when i == -1, +// s[i+len(sep):] may yield a valid substring (e.g. s[0:] for single-byte +// separators), but "after" would be "". +// +// When len(substr)==1, it's safe to use s[i+1:] even when i < 0. +// Otherwise, each replacement of s[i+1:] must be guarded by a check +// that i is nonnegative. +func checkIdxUses(info *types.Info, uses iter.Seq[inspector.Cursor], s, substr ast.Expr, iObj types.Object) (negative, nonnegative, beforeSlice, afterSlice []ast.Expr) { + requireGuard := true + if l := constSubstrLen(info, substr); l != -1 && l != 1 { + requireGuard = false + } + use := func(cur inspector.Cursor) bool { ek := cur.ParentEdgeKind() n := cur.Parent().Node() switch ek { case edge.BinaryExpr_X, edge.BinaryExpr_Y: check := n.(*ast.BinaryExpr) - switch checkIdxComparison(info, check) { + switch checkIdxComparison(info, check, iObj) { case -1: negative = append(negative, check) return true @@ -397,10 +451,10 @@ func checkIdxUses(info *types.Info, uses iter.Seq[inspector.Cursor], s, substr a if slice, ok := cur.Parent().Parent().Node().(*ast.SliceExpr); ok && sameObject(info, s, slice.X) && slice.Max == nil { - if isBeforeSlice(info, ek, slice) { + if isBeforeSlice(info, ek, slice) && (!requireGuard || isSliceIndexGuarded(info, cur, iObj)) { beforeSlice = append(beforeSlice, slice) return true - } else if isAfterSlice(info, ek, slice, substr) { + } else if isAfterSlice(info, ek, slice, substr) && (!requireGuard || isSliceIndexGuarded(info, cur, iObj)) { afterSlice = append(afterSlice, slice) return true } @@ -410,10 +464,10 @@ func checkIdxUses(info *types.Info, uses iter.Seq[inspector.Cursor], s, substr a // Check that the thing being sliced is s and that the slice doesn't // have a max index. if sameObject(info, s, slice.X) && slice.Max == nil { - if isBeforeSlice(info, ek, slice) { + if isBeforeSlice(info, ek, slice) && (!requireGuard || isSliceIndexGuarded(info, cur, iObj)) { beforeSlice = append(beforeSlice, slice) return true - } else if isAfterSlice(info, ek, slice, substr) { + } else if isAfterSlice(info, ek, slice, substr) && (!requireGuard || isSliceIndexGuarded(info, cur, iObj)) { afterSlice = append(afterSlice, slice) return true } @@ -465,8 +519,15 @@ func hasModifyingUses(info *types.Info, uses iter.Seq[inspector.Cursor], afterPo // Since strings.Index returns exactly -1 if the substring is not found, we // don't need to handle expressions like i <= -3. // We return 0 if the expression does not match any of these options. -// We assume that a check passed to checkIdxComparison has i as one of its operands. -func checkIdxComparison(info *types.Info, check *ast.BinaryExpr) int { +func checkIdxComparison(info *types.Info, check *ast.BinaryExpr, iObj types.Object) int { + isI := func(e ast.Expr) bool { + id, ok := e.(*ast.Ident) + return ok && info.Uses[id] == iObj + } + if !isI(check.X) && !isI(check.Y) { + return 0 + } + // Ensure that the constant (if any) is on the right. x, op, y := check.X, check.Op, check.Y if info.Types[x].Value != nil { @@ -515,43 +576,48 @@ func isBeforeSlice(info *types.Info, ek edge.Kind, slice *ast.SliceExpr) bool { return ek == edge.SliceExpr_High && (slice.Low == nil || isZeroIntConst(info, slice.Low)) } -// isAfterSlice reports whether the SliceExpr is of the form s[i+len(substr):], -// or s[i + k:] where k is a const is equal to len(substr). -func isAfterSlice(info *types.Info, ek edge.Kind, slice *ast.SliceExpr, substr ast.Expr) bool { - lowExpr, ok := slice.Low.(*ast.BinaryExpr) - if !ok || slice.High != nil { - return false - } - // Returns true if the expression is a call to len(substr). - isLenCall := func(expr ast.Expr) bool { - call, ok := expr.(*ast.CallExpr) - if !ok || len(call.Args) != 1 { - return false - } - return sameObject(info, substr, call.Args[0]) && typeutil.Callee(info, call) == builtinLen - } - +// constSubstrLen returns the constant length of substr, or -1 if unknown. +func constSubstrLen(info *types.Info, substr ast.Expr) int { // Handle len([]byte(substr)) - if is[*ast.CallExpr](substr) { - call := substr.(*ast.CallExpr) + if call, ok := substr.(*ast.CallExpr); ok { tv := info.Types[call.Fun] if tv.IsType() && types.Identical(tv.Type, byteSliceType) { // Only one arg in []byte conversion. substr = call.Args[0] } } - substrLen := -1 substrVal := info.Types[substr].Value if substrVal != nil { switch substrVal.Kind() { case constant.String: - substrLen = len(constant.StringVal(substrVal)) + return len(constant.StringVal(substrVal)) case constant.Int: // constant.Value is a byte literal, e.g. bytes.IndexByte(_, 'a') // or a numeric byte literal, e.g. bytes.IndexByte(_, 65) - substrLen = 1 + // ([]byte(rune) is not legal.) + return 1 } } + return -1 +} + +// isAfterSlice reports whether the SliceExpr is of the form s[i+len(substr):], +// or s[i + k:] where k is a const is equal to len(substr). +func isAfterSlice(info *types.Info, ek edge.Kind, slice *ast.SliceExpr, substr ast.Expr) bool { + lowExpr, ok := slice.Low.(*ast.BinaryExpr) + if !ok || slice.High != nil { + return false + } + // Returns true if the expression is a call to len(substr). + isLenCall := func(expr ast.Expr) bool { + call, ok := expr.(*ast.CallExpr) + if !ok || len(call.Args) != 1 { + return false + } + return sameObject(info, substr, call.Args[0]) && typeutil.Callee(info, call) == builtinLen + } + + substrLen := constSubstrLen(info, substr) switch ek { case edge.BinaryExpr_X: @@ -578,6 +644,75 @@ func isAfterSlice(info *types.Info, ek edge.Kind, slice *ast.SliceExpr, substr a return false } +// isSliceIndexGuarded reports whether a use of the index variable i (at the given cursor) +// inside a slice expression is dominated by a nonnegative guard. +// A use is considered guarded if any of the following are true: +// - It is inside the Body of an IfStmt whose condition is a nonnegative check on i. +// - It is inside the Else of an IfStmt whose condition is a negative check on i. +// - It is preceded (in the same block) by an IfStmt whose condition is a +// negative check on i with a terminating body (e.g., early return). +// +// Conversely, a use is immediately rejected if: +// - It is inside the Body of an IfStmt whose condition is a negative check on i. +// - It is inside the Else of an IfStmt whose condition is a nonnegative check on i. +// +// We have already checked (see [hasModifyingUses]) that there are no +// intervening uses (incl. via aliases) of i that might alter its value. +func isSliceIndexGuarded(info *types.Info, cur inspector.Cursor, iObj types.Object) bool { + for anc := range cur.Enclosing() { + switch anc.ParentEdgeKind() { + case edge.IfStmt_Body, edge.IfStmt_Else: + ifStmt := anc.Parent().Node().(*ast.IfStmt) + check := condChecksIdx(info, ifStmt.Cond, iObj) + if anc.ParentEdgeKind() == edge.IfStmt_Else { + check = -check + } + if check > 0 { + return true // inside nonnegative-guarded block (i >= 0 here) + } + if check < 0 { + return false // inside negative-guarded block (i < 0 here) + } + case edge.BlockStmt_List: + // Check preceding siblings for early-return negative checks. + for sib, ok := anc.PrevSibling(); ok; sib, ok = sib.PrevSibling() { + ifStmt, ok := sib.Node().(*ast.IfStmt) + if ok && condChecksIdx(info, ifStmt.Cond, iObj) < 0 && bodyTerminates(ifStmt.Body) { + return true // preceded by early-return negative check + } + } + case edge.FuncDecl_Body, edge.FuncLit_Body: + return false // stop at function boundary + } + } + return false +} + +// condChecksIdx reports whether cond is a BinaryExpr that checks +// the index variable iObj for negativity or non-negativity. +// Returns -1 for negative (e.g. i < 0), +1 for nonnegative (e.g. i >= 0), 0 otherwise. +func condChecksIdx(info *types.Info, cond ast.Expr, iObj types.Object) int { + binExpr, ok := cond.(*ast.BinaryExpr) + if !ok { + return 0 + } + return checkIdxComparison(info, binExpr, iObj) +} + +// bodyTerminates reports whether the given block statement unconditionally +// terminates execution (via return, break, continue, or goto). +func bodyTerminates(block *ast.BlockStmt) bool { + if len(block.List) == 0 { + return false + } + last := block.List[len(block.List)-1] + switch last.(type) { + case *ast.ReturnStmt, *ast.BranchStmt: + return true // return, break, continue, goto + } + return false +} + // sameObject reports whether we know that the expressions resolve to the same object. func sameObject(info *types.Info, expr1, expr2 ast.Expr) bool { if ident1, ok := expr1.(*ast.Ident); ok { diff --git a/vendor/golang.org/x/tools/go/analysis/passes/modernize/stringscutprefix.go b/vendor/golang.org/x/tools/go/analysis/passes/modernize/stringscutprefix.go index 7dc11308d..ae6345400 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/modernize/stringscutprefix.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/modernize/stringscutprefix.go @@ -201,8 +201,7 @@ func stringscutprefix(pass *analysis.Pass) (any, error) { if astutil.EqualSyntax(lhs, bin.X) && astutil.EqualSyntax(call.Args[0], bin.Y) || (astutil.EqualSyntax(lhs, bin.Y) && astutil.EqualSyntax(call.Args[0], bin.X)) { - // TODO(adonovan): avoid FreshName when not needed; see errorsastype. - okVarName := refactor.FreshName(info.Scopes[ifStmt], ifStmt.Pos(), "ok") + okVarName := freshName(info, index, info.Scopes[ifStmt], ifStmt.Pos(), curIfStmt, curIfStmt, token.NoPos, "ok") // Have one of: // if rest := TrimPrefix(s, prefix); rest != s { (ditto Suffix) // if rest := TrimPrefix(s, prefix); s != rest { (ditto Suffix) diff --git a/vendor/golang.org/x/tools/go/analysis/passes/modernize/unsafefuncs.go b/vendor/golang.org/x/tools/go/analysis/passes/modernize/unsafefuncs.go index 0b36908ec..191eba95c 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/modernize/unsafefuncs.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/modernize/unsafefuncs.go @@ -56,11 +56,6 @@ func unsafefuncs(pass *analysis.Pass) (any, error) { tUnsafePointer = types.Typ[types.UnsafePointer] ) - isInteger := func(t types.Type) bool { - basic, ok := t.Underlying().(*types.Basic) - return ok && basic.Info()&types.IsInteger != 0 - } - // isConversion reports whether e is a conversion T(x). // If so, it returns T and x. isConversion := func(curExpr inspector.Cursor) (t types.Type, x inspector.Cursor) { @@ -208,3 +203,8 @@ func deleteConv(cur inspector.Cursor) []analysis.TextEdit { }, } } + +func isInteger(t types.Type) bool { + basic, ok := t.Underlying().(*types.Basic) + return ok && basic.Info()&types.IsInteger != 0 +} diff --git a/vendor/golang.org/x/tools/go/analysis/passes/modernize/waitgroup.go b/vendor/golang.org/x/tools/go/analysis/passes/modernize/waitgroup.go index abf5885ce..5e4258710 100644 --- a/vendor/golang.org/x/tools/go/analysis/passes/modernize/waitgroup.go +++ b/vendor/golang.org/x/tools/go/analysis/passes/modernize/waitgroup.go @@ -97,6 +97,9 @@ func waitgroup(pass *analysis.Pass) (any, error) { if !ok || len(goStmt.Call.Args) != 0 { continue // go argument is not func(){...}() } + if lit.Type.Results != nil && len(lit.Type.Results.List) > 0 { + continue // function literal has return values; wg.Go requires func() + } list := lit.Body.List if len(list) == 0 { continue diff --git a/vendor/golang.org/x/tools/go/packages/golist.go b/vendor/golang.org/x/tools/go/packages/golist.go index 680a70ca8..a6c17cf63 100644 --- a/vendor/golang.org/x/tools/go/packages/golist.go +++ b/vendor/golang.org/x/tools/go/packages/golist.go @@ -61,13 +61,42 @@ func (r *responseDeduper) addAll(dr *DriverResponse) { } func (r *responseDeduper) addPackage(p *Package) { - if r.seenPackages[p.ID] != nil { + if prev := r.seenPackages[p.ID]; prev != nil { + // Package already seen in a previous response. Merge the file lists, + // removing duplicates. This can happen when the same package appears + // in multiple driver responses that are being merged together. + prev.GoFiles = appendUniqueStrings(prev.GoFiles, p.GoFiles) + prev.CompiledGoFiles = appendUniqueStrings(prev.CompiledGoFiles, p.CompiledGoFiles) + prev.OtherFiles = appendUniqueStrings(prev.OtherFiles, p.OtherFiles) + prev.IgnoredFiles = appendUniqueStrings(prev.IgnoredFiles, p.IgnoredFiles) + prev.EmbedFiles = appendUniqueStrings(prev.EmbedFiles, p.EmbedFiles) + prev.EmbedPatterns = appendUniqueStrings(prev.EmbedPatterns, p.EmbedPatterns) return } r.seenPackages[p.ID] = p r.dr.Packages = append(r.dr.Packages, p) } +// appendUniqueStrings appends elements from src to dst, skipping duplicates. +func appendUniqueStrings(dst, src []string) []string { + if len(src) == 0 { + return dst + } + + seen := make(map[string]bool, len(dst)) + for _, s := range dst { + seen[s] = true + } + + for _, s := range src { + if !seen[s] { + dst = append(dst, s) + } + } + + return dst +} + func (r *responseDeduper) addRoot(id string) { if r.seenRoots[id] { return @@ -832,6 +861,8 @@ func golistargs(cfg *Config, words []string, goVersion int) []string { // go list doesn't let you pass -test and -find together, // probably because you'd just get the TestMain. fmt.Sprintf("-find=%t", !cfg.Tests && cfg.Mode&findFlags == 0 && !usesExportData(cfg)), + // VCS information is not needed when not printing Stale or StaleReason fields + "-buildvcs=false", } // golang/go#60456: with go1.21 and later, go list serves pgo variants, which diff --git a/vendor/golang.org/x/tools/go/packages/packages.go b/vendor/golang.org/x/tools/go/packages/packages.go index b249a5c7e..412ba06b5 100644 --- a/vendor/golang.org/x/tools/go/packages/packages.go +++ b/vendor/golang.org/x/tools/go/packages/packages.go @@ -403,6 +403,10 @@ func mergeResponses(responses ...*DriverResponse) *DriverResponse { if len(responses) == 0 { return nil } + // No dedup needed + if len(responses) == 1 { + return responses[0] + } response := newDeduper() response.dr.NotHandled = false response.dr.Compiler = responses[0].Compiler diff --git a/vendor/golang.org/x/tools/go/ssa/builder.go b/vendor/golang.org/x/tools/go/ssa/builder.go index a75257c8b..3336203b1 100644 --- a/vendor/golang.org/x/tools/go/ssa/builder.go +++ b/vendor/golang.org/x/tools/go/ssa/builder.go @@ -1467,13 +1467,14 @@ func (b *builder) switchStmt(fn *Function, s *ast.SwitchStmt, label *lblock) { var nextCond *BasicBlock for _, cond := range cc.List { nextCond = fn.newBasicBlock("switch.next") - // TODO(adonovan): opt: when tag==vTrue, we'd - // get better code if we use b.cond(cond) - // instead of BinOp(EQL, tag, b.expr(cond)) - // followed by If. Don't forget conversions - // though. - cond := emitCompare(fn, token.EQL, tag, b.expr(fn, cond), cond.Pos()) - emitIf(fn, cond, body, nextCond) + // For boolean switches, emit short-circuit control flow, + // just like an if/else-chain. + if tag == vTrue && !isNonTypeParamInterface(fn.info.Types[cond].Type) { + b.cond(fn, cond, body, nextCond) + } else { + c := emitCompare(fn, token.EQL, tag, b.expr(fn, cond), cond.Pos()) + emitIf(fn, c, body, nextCond) + } fn.currentBlock = nextCond } fn.currentBlock = body diff --git a/vendor/golang.org/x/tools/internal/astutil/comment.go b/vendor/golang.org/x/tools/internal/astutil/comment.go index 7e52aeaaa..5ed4765c7 100644 --- a/vendor/golang.org/x/tools/internal/astutil/comment.go +++ b/vendor/golang.org/x/tools/internal/astutil/comment.go @@ -31,7 +31,7 @@ func Deprecation(doc *ast.CommentGroup) string { // -- plundered from the future (CL 605517, issue #68021) -- -// TODO(adonovan): replace with ast.Directive after go1.25 (#68021). +// TODO(adonovan): replace with ast.Directive in go1.26 (#68021). // Beware of our local mods to handle analysistest // "want" comments on the same line. diff --git a/vendor/golang.org/x/tools/internal/astutil/stringlit.go b/vendor/golang.org/x/tools/internal/astutil/stringlit.go index ce1e7de88..eb49d4512 100644 --- a/vendor/golang.org/x/tools/internal/astutil/stringlit.go +++ b/vendor/golang.org/x/tools/internal/astutil/stringlit.go @@ -40,20 +40,64 @@ func PosInStringLiteral(lit *ast.BasicLit, offset int) (token.Pos, error) { return 0, fmt.Errorf("invalid offset") } + pos, _ := walkStringLiteral(lit, lit.End(), offset) + return pos, nil +} + +// OffsetInStringLiteral returns the byte offset within the logical (unquoted) +// string corresponding to the specified source position. +func OffsetInStringLiteral(lit *ast.BasicLit, pos token.Pos) (int, error) { + if !NodeContainsPos(lit, pos) { + return 0, fmt.Errorf("invalid position") + } + + raw := lit.Value + + value, err := strconv.Unquote(raw) + if err != nil { + return 0, err + } + + _, offset := walkStringLiteral(lit, pos, len(value)) + return offset, nil +} + +// walkStringLiteral iterates through the raw string literal to map between +// a file position and a logical byte offset. It stops when it reaches +// either the targetPos or the targetOffset. +// +// TODO(hxjiang): consider making an iterator. +func walkStringLiteral(lit *ast.BasicLit, targetPos token.Pos, targetOffset int) (token.Pos, int) { + raw := lit.Value + norm := int(lit.End()-lit.Pos()) > len(lit.Value) + // remove quotes quote := raw[0] // '"' or '`' raw = raw[1 : len(raw)-1] var ( - i = 0 // byte index within logical value - pos = lit.ValuePos + 1 // position within literal + i = 0 // byte index within logical value + pos = lit.Pos() + 1 // position within literal ) - for raw != "" && i < offset { + + for raw != "" { r, _, rest, _ := strconv.UnquoteChar(raw, quote) // can't fail sz := len(raw) - len(rest) // length of literal char in raw bytes - pos += token.Pos(sz) + + nextPos := pos + token.Pos(sz) + if norm && r == '\n' { + nextPos++ + } + nextI := i + utf8.RuneLen(r) // length of logical char in "cooked" bytes + + if nextPos > targetPos || nextI > targetOffset { + break + } + raw = raw[sz:] - i += utf8.RuneLen(r) + i = nextI + pos = nextPos } - return pos, nil + + return pos, i } diff --git a/vendor/golang.org/x/tools/internal/astutil/util.go b/vendor/golang.org/x/tools/internal/astutil/util.go index 6378b50c5..f211d2cc3 100644 --- a/vendor/golang.org/x/tools/internal/astutil/util.go +++ b/vendor/golang.org/x/tools/internal/astutil/util.go @@ -15,40 +15,6 @@ import ( "golang.org/x/tools/internal/moreiters" ) -// PreorderStack traverses the tree rooted at root, -// calling f before visiting each node. -// -// Each call to f provides the current node and traversal stack, -// consisting of the original value of stack appended with all nodes -// from root to n, excluding n itself. (This design allows calls -// to PreorderStack to be nested without double counting.) -// -// If f returns false, the traversal skips over that subtree. Unlike -// [ast.Inspect], no second call to f is made after visiting node n. -// In practice, the second call is nearly always used only to pop the -// stack, and it is surprisingly tricky to do this correctly; see -// https://go.dev/issue/73319. -// -// TODO(adonovan): replace with [ast.PreorderStack] when go1.25 is assured. -func PreorderStack(root ast.Node, stack []ast.Node, f func(n ast.Node, stack []ast.Node) bool) { - before := len(stack) - ast.Inspect(root, func(n ast.Node) bool { - if n != nil { - if !f(n, stack) { - // Do not push, as there will be no corresponding pop. - return false - } - stack = append(stack, n) // push - } else { - stack = stack[:len(stack)-1] // pop - } - return true - }) - if len(stack) != before { - panic("push/pop mismatch") - } -} - // NodeContains reports whether the Pos/End range of node n encloses // the given range. // diff --git a/vendor/golang.org/x/tools/internal/goplsexport/export.go b/vendor/golang.org/x/tools/internal/goplsexport/export.go index b0572f596..231e3f218 100644 --- a/vendor/golang.org/x/tools/internal/goplsexport/export.go +++ b/vendor/golang.org/x/tools/internal/goplsexport/export.go @@ -14,4 +14,5 @@ var ( PlusBuildModernizer *analysis.Analyzer // = modernize.plusbuildAnalyzer StringsCutModernizer *analysis.Analyzer // = modernize.stringscutAnalyzer UnsafeFuncsModernizer *analysis.Analyzer // = modernize.unsafeFuncsAnalyzer + AtomicModernizer *analysis.Analyzer // = modernize.atomicAnalyzer ) diff --git a/vendor/golang.org/x/tools/internal/refactor/refactor.go b/vendor/golang.org/x/tools/internal/refactor/refactor.go index 8664377f8..1d6c05433 100644 --- a/vendor/golang.org/x/tools/internal/refactor/refactor.go +++ b/vendor/golang.org/x/tools/internal/refactor/refactor.go @@ -17,10 +17,9 @@ import ( // FreshName returns the name of an identifier that is undefined // at the specified position, based on the preferred name. // -// TODO(adonovan): refine this to choose a fresh name only when there -// would be a conflict with the existing declaration: it's fine to -// redeclare a name in a narrower scope so long as there are no free -// references to the outer name from within the narrower scope. +// export/use freshName in go/analysis/passes/modernize/modernize.go if you want +// to generate a fresh name only when necessary (i.e., there is both an existing +// declaration and some free reference to the name within a narrower scope) func FreshName(scope *types.Scope, pos token.Pos, preferred string) string { newName := preferred for i := 0; ; i++ { diff --git a/vendor/golang.org/x/tools/refactor/satisfy/find.go b/vendor/golang.org/x/tools/refactor/satisfy/find.go index bb3837553..3d21ce6d2 100644 --- a/vendor/golang.org/x/tools/refactor/satisfy/find.go +++ b/vendor/golang.org/x/tools/refactor/satisfy/find.go @@ -395,8 +395,11 @@ func (f *Finder) expr(e ast.Expr) types.Type { f.expr(e.X) case *ast.SelectorExpr: - if _, ok := f.info.Selections[e]; ok { - f.expr(e.X) // selection + if seln, ok := f.info.Selections[e]; ok { + // If e.X is a type (e.g., e is interface{ m() }.m), don't visit it. + if seln.Kind() != types.MethodExpr { + f.expr(e.X) + } } else { return f.info.Uses[e.Sel].Type() // qualified identifier } diff --git a/vendor/modules.txt b/vendor/modules.txt index 779e18bf8..7f3e52ebc 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1548,8 +1548,8 @@ go.yaml.in/yaml/v2 # go.yaml.in/yaml/v3 v3.0.4 ## explicit; go 1.16 go.yaml.in/yaml/v3 -# golang.org/x/crypto v0.48.0 -## explicit; go 1.24.0 +# golang.org/x/crypto v0.50.0 +## explicit; go 1.25.0 golang.org/x/crypto/blowfish golang.org/x/crypto/chacha20 golang.org/x/crypto/curve25519 @@ -1565,14 +1565,14 @@ golang.org/x/exp/slices # golang.org/x/exp/typeparams v0.0.0-20260209203927-2842357ff358 ## explicit; go 1.24.0 golang.org/x/exp/typeparams -# golang.org/x/mod v0.33.0 -## explicit; go 1.24.0 +# golang.org/x/mod v0.34.0 +## explicit; go 1.25.0 golang.org/x/mod/internal/lazyregexp golang.org/x/mod/modfile golang.org/x/mod/module golang.org/x/mod/semver golang.org/x/mod/sumdb/dirhash -# golang.org/x/net v0.51.0 +# golang.org/x/net v0.53.0 ## explicit; go 1.25.0 golang.org/x/net/html golang.org/x/net/html/atom @@ -1592,23 +1592,23 @@ golang.org/x/net/websocket ## explicit; go 1.24.0 golang.org/x/oauth2 golang.org/x/oauth2/internal -# golang.org/x/sync v0.19.0 -## explicit; go 1.24.0 +# golang.org/x/sync v0.20.0 +## explicit; go 1.25.0 golang.org/x/sync/errgroup golang.org/x/sync/semaphore golang.org/x/sync/singleflight -# golang.org/x/sys v0.41.0 -## explicit; go 1.24.0 +# golang.org/x/sys v0.43.0 +## explicit; go 1.25.0 golang.org/x/sys/cpu golang.org/x/sys/plan9 golang.org/x/sys/unix golang.org/x/sys/windows golang.org/x/sys/windows/registry -# golang.org/x/term v0.40.0 -## explicit; go 1.24.0 +# golang.org/x/term v0.42.0 +## explicit; go 1.25.0 golang.org/x/term -# golang.org/x/text v0.34.0 -## explicit; go 1.24.0 +# golang.org/x/text v0.36.0 +## explicit; go 1.25.0 golang.org/x/text/cases golang.org/x/text/encoding golang.org/x/text/encoding/charmap @@ -1642,8 +1642,8 @@ golang.org/x/text/width # golang.org/x/time v0.14.0 ## explicit; go 1.24.0 golang.org/x/time/rate -# golang.org/x/tools v0.42.0 -## explicit; go 1.24.0 +# golang.org/x/tools v0.43.0 +## explicit; go 1.25.0 golang.org/x/tools/cover golang.org/x/tools/go/analysis golang.org/x/tools/go/analysis/passes/appends