Skip to content

Commit 0f99a4e

Browse files
build(deps): bump the go-modules group with 2 updates (#207)
Bumps the go-modules group with 2 updates: [github.com/lib/pq](https://github.com/lib/pq) and [github.com/bytedance/gopkg](https://github.com/bytedance/gopkg). Updates `github.com/lib/pq` from 1.11.2 to 1.12.0 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/lib/pq/releases">github.com/lib/pq's releases</a>.</em></p> <blockquote> <h2>v1.12.0</h2> <ul> <li> <p>The next release may change the default sslmode from <code>require</code> to <code>prefer</code>. See <a href="https://redirect.github.com/lib/pq/issues/1271">#1271</a> for details.</p> </li> <li> <p><code>CopyIn()</code> and <code>CopyInToSchema()</code> have been marked as deprecated. These are simple query builders and not needed for <code>COPY [..] FROM STDIN</code> support (which is <em>not</em> deprecated). (<a href="https://redirect.github.com/lib/pq/issues/1279">#1279</a>)</p> <pre><code>// Old tx.Prepare(CopyIn(&quot;temp&quot;, &quot;num&quot;, &quot;text&quot;, &quot;blob&quot;, &quot;nothing&quot;)) <p>// Replacement tx.Prepare(<code>copy temp (num, text, blob, nothing) from stdin</code>) </code></pre></p> </li> </ul> <h3>Features</h3> <ul> <li> <p>Support protocol 3.2, and the <code>min_protocol_version</code> and <code>max_protocol_version</code> DSN parameters (<a href="https://redirect.github.com/lib/pq/issues/1258">#1258</a>).</p> </li> <li> <p>Support <code>sslmode=prefer</code> and <code>sslmode=allow</code> (<a href="https://redirect.github.com/lib/pq/issues/1270">#1270</a>).</p> </li> <li> <p>Support <code>ssl_min_protocol_version</code> and <code>ssl_max_protocol_version</code> (<a href="https://redirect.github.com/lib/pq/issues/1277">#1277</a>).</p> </li> <li> <p>Support connection service file to load connection details (<a href="https://redirect.github.com/lib/pq/issues/1285">#1285</a>).</p> </li> <li> <p>Support <code>sslrootcert=system</code> and use <code>~/.postgresql/root.crt</code> as the default value of sslrootcert (<a href="https://redirect.github.com/lib/pq/issues/1280">#1280</a>, <a href="https://redirect.github.com/lib/pq/issues/1281">#1281</a>).</p> </li> <li> <p>Add a new <code>pqerror</code> package with PostgreSQL error codes (<a href="https://redirect.github.com/lib/pq/issues/1275">#1275</a>).</p> <p>For example, to test if an error is a UNIQUE constraint violation:</p> <pre><code>if pqErr, ok := errors.AsType[*pq.Error](https://github.com/lib/pq/blob/HEAD/err); ok &amp;&amp; pqErr.Code == pqerror.UniqueViolation { log.Fatalf(&quot;email %q already exsts&quot;, email) } </code></pre> <p>To make this a bit more convenient, it also adds a <code>pq.As()</code> function:</p> <pre><code>pqErr := pq.As(err, pqerror.UniqueViolation) if pqErr != nil { log.Fatalf(&quot;email %q already exsts&quot;, email) } </code></pre> </li> </ul> <h3>Fixes</h3> <ul> <li> <p>Fix SSL key permission check to allow modes stricter than 0600/0640 (<a href="https://redirect.github.com/lib/pq/issues/1265">#1265</a>).</p> </li> <li> <p>Fix Hstore to work with binary parameters (<a href="https://redirect.github.com/lib/pq/issues/1278">#1278</a>).</p> </li> <li> <p>Clearer error when starting a new query while pq is still processing another query (<a href="https://redirect.github.com/lib/pq/issues/1272">#1272</a>).</p> </li> <li> <p>Send intermediate CAs with client certificates, so they can be signed by an intermediate CA (<a href="https://redirect.github.com/lib/pq/issues/1267">#1267</a>).</p> </li> <li> <p>Use <code>time.UTC</code> for UTC aliases such as <code>Etc/UTC</code> (<a href="https://redirect.github.com/lib/pq/issues/1283">#1283</a>).</p> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/lib/pq/blob/master/CHANGELOG.md">github.com/lib/pq's changelog</a>.</em></p> <blockquote> <h2>v1.12.0 (2026-03-18)</h2> <ul> <li> <p>The next release may change the default sslmode from <code>require</code> to <code>prefer</code>. See <a href="https://redirect.github.com/lib/pq/issues/1271">#1271</a> for details.</p> </li> <li> <p><code>CopyIn()</code> and <code>CopyInToSchema()</code> have been marked as deprecated. These are simple query builders and not needed for <code>COPY [..] FROM STDIN</code> support (which is <em>not</em> deprecated). (<a href="https://redirect.github.com/lib/pq/issues/1279">#1279</a>)</p> <pre><code>// Old tx.Prepare(CopyIn(&quot;temp&quot;, &quot;num&quot;, &quot;text&quot;, &quot;blob&quot;, &quot;nothing&quot;)) <p>// Replacement tx.Prepare(<code>copy temp (num, text, blob, nothing) from stdin</code>) </code></pre></p> </li> </ul> <h3>Features</h3> <ul> <li> <p>Support protocol 3.2, and the <code>min_protocol_version</code> and <code>max_protocol_version</code> DSN parameters (<a href="https://redirect.github.com/lib/pq/issues/1258">#1258</a>).</p> </li> <li> <p>Support <code>sslmode=prefer</code> and <code>sslmode=allow</code> (<a href="https://redirect.github.com/lib/pq/issues/1270">#1270</a>).</p> </li> <li> <p>Support <code>ssl_min_protocol_version</code> and <code>ssl_max_protocol_version</code> (<a href="https://redirect.github.com/lib/pq/issues/1277">#1277</a>).</p> </li> <li> <p>Support connection service file to load connection details (<a href="https://redirect.github.com/lib/pq/issues/1285">#1285</a>).</p> </li> <li> <p>Support <code>sslrootcert=system</code> and use <code>~/.postgresql/root.crt</code> as the default value of sslrootcert (<a href="https://redirect.github.com/lib/pq/issues/1280">#1280</a>, <a href="https://redirect.github.com/lib/pq/issues/1281">#1281</a>).</p> </li> <li> <p>Add a new <code>pqerror</code> package with PostgreSQL error codes (<a href="https://redirect.github.com/lib/pq/issues/1275">#1275</a>).</p> <p>For example, to test if an error is a UNIQUE constraint violation:</p> <pre><code>if pqErr, ok := errors.AsType[*pq.Error](https://github.com/lib/pq/blob/master/err); ok &amp;&amp; pqErr.Code == pqerror.UniqueViolation { log.Fatalf(&quot;email %q already exsts&quot;, email) } </code></pre> <p>To make this a bit more convenient, it also adds a <code>pq.As()</code> function:</p> <pre><code>pqErr := pq.As(err, pqerror.UniqueViolation) if pqErr != nil { log.Fatalf(&quot;email %q already exsts&quot;, email) } </code></pre> </li> </ul> <h3>Fixes</h3> <ul> <li> <p>Fix SSL key permission check to allow modes stricter than <a href="https://redirect.github.com/0600/0640/issues/0600">0600/06400600</a> (<a href="https://redirect.github.com/lib/pq/issues/1265">#1265</a>).</p> </li> <li> <p>Fix Hstore to work with binary parameters (<a href="https://redirect.github.com/lib/pq/issues/1278">#1278</a>).</p> </li> </ul> <!-- raw HTML omitted --> </blockquote> <p>... (truncated)</p> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/lib/pq/commit/42ab0ff7c4b1b585fa6cd216a12a126715b5af06"><code>42ab0ff</code></a> Change default sslmode from &quot;require&quot; to &quot;prefer&quot;</li> <li><a href="https://github.com/lib/pq/commit/6d40f13cfefe5ae4b489404b45114ba03224947a"><code>6d40f13</code></a> Release v1.12.0</li> <li><a href="https://github.com/lib/pq/commit/386fc0e764f82951e9706dd8e618fc416fb5fb2c"><code>386fc0e</code></a> Document NULL behaviour with COPY</li> <li><a href="https://github.com/lib/pq/commit/a62682e9083edee5ffe2d3904e80c30aaaa0877f"><code>a62682e</code></a> Better staticcheck cache 2</li> <li><a href="https://github.com/lib/pq/commit/87ee06c600347478cfef07ad31b5ea617008aee7"><code>87ee06c</code></a> Better staticcheck cache</li> <li><a href="https://github.com/lib/pq/commit/09624587cd3d4b69cd4a1a3b403b544ec0ddb2f7"><code>0962458</code></a> Rewrite tests to use pqerror, pq.As()</li> <li><a href="https://github.com/lib/pq/commit/0d209810a155b9b8a173ab6d5da332f8c6cbc2c9"><code>0d20981</code></a> Don't move pq.Error to pqerror.Error</li> <li><a href="https://github.com/lib/pq/commit/433213859e656dfe7dbba17b2838839e03a43ca2"><code>4332138</code></a> Add pqerror package</li> <li><a href="https://github.com/lib/pq/commit/620d6d50817f9c4dcbfcbfeadb12ec552b636bf3"><code>620d6d5</code></a> Make tests run faster</li> <li><a href="https://github.com/lib/pq/commit/dc8ff5d519b00bfa67626e68ea1ff3fdde0cc1b2"><code>dc8ff5d</code></a> Implement connection service file</li> <li>Additional commits viewable in <a href="https://github.com/lib/pq/compare/v1.11.2...v1.12.0">compare view</a></li> </ul> </details> <br /> Updates `github.com/bytedance/gopkg` from 0.1.3 to 0.1.4 <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/bytedance/gopkg/releases">github.com/bytedance/gopkg's releases</a>.</em></p> <blockquote> <h2>v0.1.4</h2> <h2>What's Changed</h2> <ul> <li>fix(lang/dirtmake): compat with tinygo by <a href="https://github.com/xiaost"><code>@​xiaost</code></a> in <a href="https://redirect.github.com/bytedance/gopkg/pull/253">bytedance/gopkg#253</a></li> <li>feat(circuitbreaker): cleanup breakers with no samples to prevent memory leak by <a href="https://github.com/PureWhiteWu"><code>@​PureWhiteWu</code></a> in <a href="https://redirect.github.com/bytedance/gopkg/pull/254">bytedance/gopkg#254</a></li> <li>fix: typos/grammar, and zset perf by <a href="https://github.com/xiaost"><code>@​xiaost</code></a> in <a href="https://redirect.github.com/bytedance/gopkg/pull/255">bytedance/gopkg#255</a></li> <li>chore: update code owners by <a href="https://github.com/JasonChen233"><code>@​JasonChen233</code></a> in <a href="https://redirect.github.com/bytedance/gopkg/pull/257">bytedance/gopkg#257</a></li> <li>chore(README): updated to reflect current status by <a href="https://github.com/xiaost"><code>@​xiaost</code></a> in <a href="https://redirect.github.com/bytedance/gopkg/pull/258">bytedance/gopkg#258</a></li> <li>chore: update codeowners by <a href="https://github.com/xiaost"><code>@​xiaost</code></a> in <a href="https://redirect.github.com/bytedance/gopkg/pull/261">bytedance/gopkg#261</a></li> <li>refactor: clean up dependencies by <a href="https://github.com/xiaost"><code>@​xiaost</code></a> in <a href="https://redirect.github.com/bytedance/gopkg/pull/262">bytedance/gopkg#262</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/JasonChen233"><code>@​JasonChen233</code></a> made their first contribution in <a href="https://redirect.github.com/bytedance/gopkg/pull/257">bytedance/gopkg#257</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/bytedance/gopkg/compare/v0.1.3...v0.1.4">https://github.com/bytedance/gopkg/compare/v0.1.3...v0.1.4</a></p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/bytedance/gopkg/commit/165f9e47565258dbf687d8153427a5e1ed3e6b61"><code>165f9e4</code></a> refactor: clean up dependencies (<a href="https://redirect.github.com/bytedance/gopkg/issues/262">#262</a>)</li> <li><a href="https://github.com/bytedance/gopkg/commit/0ce263f4e9514a5b0a3adeead257ad1b438f5d3f"><code>0ce263f</code></a> chore: update codeowners (<a href="https://redirect.github.com/bytedance/gopkg/issues/261">#261</a>)</li> <li><a href="https://github.com/bytedance/gopkg/commit/a67f08b3b1c54e77ead9bca18cb0f78e4066351a"><code>a67f08b</code></a> chore(README): updated to reflect current status (<a href="https://redirect.github.com/bytedance/gopkg/issues/258">#258</a>)</li> <li><a href="https://github.com/bytedance/gopkg/commit/b17afc12773f22265621ccbeb560c857d6c30dbe"><code>b17afc1</code></a> chore: update code owners (<a href="https://redirect.github.com/bytedance/gopkg/issues/257">#257</a>)</li> <li><a href="https://github.com/bytedance/gopkg/commit/cf44e97949cbc5eb3d0366256f2413ba6a685e80"><code>cf44e97</code></a> fix: typos/grammar, and zset perf (<a href="https://redirect.github.com/bytedance/gopkg/issues/255">#255</a>)</li> <li><a href="https://github.com/bytedance/gopkg/commit/bc92114b4388cd629b11d45e3b11803bc790e9c2"><code>bc92114</code></a> Merge pull request <a href="https://redirect.github.com/bytedance/gopkg/issues/254">#254</a> from bytedance/feat/cb_cleanup</li> <li><a href="https://github.com/bytedance/gopkg/commit/25d1017695fe7b2ce9256b26e3a2b7f6029961b0"><code>25d1017</code></a> feat(circuitbreaker): cleanup breakers with no samples to prevent memory leak</li> <li><a href="https://github.com/bytedance/gopkg/commit/d6627d30fe5d62cee75b76dffe60251e68f4d33d"><code>d6627d3</code></a> fix(lang/dirtmake): compat with tinygo (<a href="https://redirect.github.com/bytedance/gopkg/issues/253">#253</a>)</li> <li>See full diff in <a href="https://github.com/bytedance/gopkg/compare/v0.1.3...v0.1.4">compare view</a></li> </ul> </details> <br /> Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore <dependency name> major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself) - `@dependabot ignore <dependency name> minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself) - `@dependabot ignore <dependency name>` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself) - `@dependabot unignore <dependency name>` will remove all of the ignore conditions of the specified dependency - `@dependabot unignore <dependency name> <ignore condition>` will remove the ignore condition of the specified dependency and ignore conditions </details> --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Marius Goetze <marius.goetze@greenbone.net>
1 parent ee473c9 commit 0f99a4e

4 files changed

Lines changed: 10 additions & 13 deletions

File tree

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ require (
1515
github.com/greenbone/opensight-golang-libraries v1.31.2-alpha1
1616
github.com/jmoiron/sqlx v1.4.0
1717
github.com/kelseyhightower/envconfig v1.4.0
18-
github.com/lib/pq v1.11.2
18+
github.com/lib/pq v1.12.0
1919
github.com/peterldowns/pgtestdb v0.1.1
2020
github.com/peterldowns/pgtestdb/migrators/golangmigrator v0.1.1
2121
github.com/rs/zerolog v1.34.0
@@ -28,7 +28,7 @@ require (
2828
require (
2929
github.com/KyleBanks/depth v1.2.1 // indirect
3030
github.com/Nerzal/gocloak/v13 v13.9.0 // indirect
31-
github.com/bytedance/gopkg v0.1.3 // indirect
31+
github.com/bytedance/gopkg v0.1.4 // indirect
3232
github.com/bytedance/sonic v1.15.0 // indirect
3333
github.com/bytedance/sonic/loader v0.5.0 // indirect
3434
github.com/cloudwego/base64x v0.1.6 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERo
1010
github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU=
1111
github.com/Nerzal/gocloak/v13 v13.9.0 h1:YWsJsdM5b0yhM2Ba3MLydiOlujkBry4TtdzfIzSVZhw=
1212
github.com/Nerzal/gocloak/v13 v13.9.0/go.mod h1:YYuDcXZ7K2zKECyVP7pPqjKxx2AzYSpKDj8d6GuyM10=
13-
github.com/bytedance/gopkg v0.1.3 h1:TPBSwH8RsouGCBcMBktLt1AymVo2TVsBVCY4b6TnZ/M=
14-
github.com/bytedance/gopkg v0.1.3/go.mod h1:576VvJ+eJgyCzdjS+c4+77QF3p7ubbtiKARP3TxducM=
13+
github.com/bytedance/gopkg v0.1.4 h1:oZnQwnX82KAIWb7033bEwtxvTqXcYMxDBaQxo5JJHWM=
14+
github.com/bytedance/gopkg v0.1.4/go.mod h1:v1zWfPm21Fb+OsyXN2VAHdL6TBb2L88anLQgdyje6R4=
1515
github.com/bytedance/sonic v1.15.0 h1:/PXeWFaR5ElNcVE84U0dOHjiMHQOwNIx3K4ymzh/uSE=
1616
github.com/bytedance/sonic v1.15.0/go.mod h1:tFkWrPz0/CUCLEF4ri4UkHekCIcdnkqXw9VduqpJh0k=
1717
github.com/bytedance/sonic/loader v0.5.0 h1:gXH3KVnatgY7loH5/TkeVyXPfESoqSBSBEiDd5VjlgE=
@@ -155,8 +155,8 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
155155
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
156156
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
157157
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
158-
github.com/lib/pq v1.11.2 h1:x6gxUeu39V0BHZiugWe8LXZYZ+Utk7hSJGThs8sdzfs=
159-
github.com/lib/pq v1.11.2/go.mod h1:/p+8NSbOcwzAEI7wiMXFlgydTwcgTr3OSKMsD2BitpA=
158+
github.com/lib/pq v1.12.0 h1:mC1zeiNamwKBecjHarAr26c/+d8V5w/u4J0I/yASbJo=
159+
github.com/lib/pq v1.12.0/go.mod h1:/p+8NSbOcwzAEI7wiMXFlgydTwcgTr3OSKMsD2BitpA=
160160
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
161161
github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE=
162162
github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8=

pkg/repository/originrepository/originRepository.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ import (
1313
"github.com/greenbone/opensight-notification-service/pkg/errs"
1414
"github.com/jmoiron/sqlx"
1515
"github.com/lib/pq"
16+
"github.com/lib/pq/pqerror"
1617
)
1718

18-
// see https://github.com/lib/pq/blob/3d613208bca2e74f2a20e04126ed30bcb5c4cc27/error.go#L78
19-
const pgErrCodeConflict = "23505"
20-
2119
type OriginRepository struct {
2220
client *sqlx.DB
2321
}
@@ -67,7 +65,7 @@ func (r *OriginRepository) UpsertOrigins(ctx context.Context, serviceID string,
6765
if err != nil {
6866
var pgErr *pq.Error
6967
if errors.As(err, &pgErr) { // postgres specific error handling
70-
if pgErr.Code == pgErrCodeConflict {
68+
if pgErr.Code == pqerror.UniqueViolation {
7169
err = &errs.ErrConflict{Message: "duplicate origin class"}
7270
}
7371
}

pkg/repository/rulerepository/ruleRepository.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ import (
1515
"github.com/greenbone/opensight-notification-service/pkg/validation"
1616
"github.com/jmoiron/sqlx"
1717
"github.com/lib/pq"
18+
"github.com/lib/pq/pqerror"
1819
)
1920

20-
const pgErrorUniqueViolationCode = "23505"
21-
2221
var ErrInvalidID error = errors.New("id is not a valid uuid-v4")
2322
var ErrDuplicateRuleName error = errors.New("rule with the same name already exists")
2423

@@ -145,7 +144,7 @@ func postgresErrorHandling(err error) error {
145144
}
146145

147146
if pgErr, ok := errors.AsType[*pq.Error](err); ok {
148-
if pgErr.Code == pgErrorUniqueViolationCode {
147+
if pgErr.Code == pqerror.UniqueViolation {
149148
return ErrDuplicateRuleName
150149
}
151150
}

0 commit comments

Comments
 (0)