Skip to content

Commit e7f34e5

Browse files
authored
feat: add SupportPackageIsVersion1 compile-time version sentinel (#27)
* feat: add SupportPackageIsVersion1 compile-time version sentinel Add version compatibility constant and reference upstream package sentinels to enforce coordinated version updates at compile time. Follows the gRPC SupportPackageIsVersion pattern. * chore: bump golang.org/x/image to v0.38.0 (fix GO-2026-4815 vuln)
1 parent c33c2da commit e7f34e5

4 files changed

Lines changed: 14 additions & 7 deletions

File tree

databuilder.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ import (
1111
* Before going throught this code please read - https://go.dev/blog/laws-of-reflection
1212
*/
1313

14+
// SupportPackageIsVersion1 is a compile-time assertion constant.
15+
// Downstream packages reference this to enforce version compatibility.
16+
const SupportPackageIsVersion1 = true
17+
1418
type builder struct {
1519
fnValue reflect.Value // cached reflect.ValueOf(builder func) to avoid repeated reflection
1620
In []string

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module github.com/go-coldbrew/data-builder
33
go 1.25.8
44

55
require (
6-
github.com/go-coldbrew/tracing v0.0.7
6+
github.com/go-coldbrew/tracing v0.1.0
77
github.com/goccy/go-graphviz v0.2.10
88
github.com/google/go-cmp v0.7.0
99
github.com/stretchr/testify v1.11.1
@@ -166,7 +166,6 @@ require (
166166
github.com/nishanths/exhaustive v0.12.0 // indirect
167167
github.com/nishanths/predeclared v0.2.2 // indirect
168168
github.com/nunnatsa/ginkgolinter v0.23.0 // indirect
169-
github.com/nxadm/tail v1.4.11 // indirect
170169
github.com/opentracing/opentracing-go v1.2.0 // indirect
171170
github.com/pelletier/go-toml v1.9.5 // indirect
172171
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
@@ -238,7 +237,7 @@ require (
238237
go.yaml.in/yaml/v3 v3.0.4 // indirect
239238
golang.org/x/crypto v0.49.0 // indirect
240239
golang.org/x/exp/typeparams v0.0.0-20260209203927-2842357ff358 // indirect
241-
golang.org/x/image v0.37.0 // indirect
240+
golang.org/x/image v0.38.0 // indirect
242241
golang.org/x/mod v0.34.0 // indirect
243242
golang.org/x/net v0.52.0 // indirect
244243
golang.org/x/sync v0.20.0 // indirect
@@ -252,6 +251,7 @@ require (
252251
google.golang.org/grpc v1.79.3 // indirect
253252
google.golang.org/protobuf v1.36.11 // indirect
254253
gopkg.in/ini.v1 v1.67.0 // indirect
254+
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
255255
gopkg.in/warnings.v0 v0.1.2 // indirect
256256
gopkg.in/yaml.v2 v2.4.0 // indirect
257257
gopkg.in/yaml.v3 v3.0.1 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ github.com/ghostiam/protogetter v0.3.20 h1:oW7OPFit2FxZOpmMRPP9FffU4uUpfeE/rEdE1
221221
github.com/ghostiam/protogetter v0.3.20/go.mod h1:FjIu5Yfs6FT391m+Fjp3fbAYJ6rkL/J6ySpZBfnODuI=
222222
github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c=
223223
github.com/gliderlabs/ssh v0.3.8/go.mod h1:xYoytBv1sV0aL3CavoDuJIQNURXkkfPA/wxQ1pL1fAU=
224-
github.com/go-coldbrew/tracing v0.0.7 h1:I6IG0EqIzP1E1w+YnFHXf3Xebuigy8r1khWWH20YR+g=
225-
github.com/go-coldbrew/tracing v0.0.7/go.mod h1:aAiSSr0x7IcIUXTa7PgXewgav51O3TCuSF+DvaaSKZs=
224+
github.com/go-coldbrew/tracing v0.1.0 h1:IwO19D3nDD3tLSGmS7s53IqML3874CAabydp+0CyaEY=
225+
github.com/go-coldbrew/tracing v0.1.0/go.mod h1:H0X8EINrdeINzTGjsJJ0lxrKIYNP73bAQdPXbdQiY5E=
226226
github.com/go-critic/go-critic v0.14.3 h1:5R1qH2iFeo4I/RJU8vTezdqs08Egi4u5p6vOESA0pog=
227227
github.com/go-critic/go-critic v0.14.3/go.mod h1:xwntfW6SYAd7h1OqDzmN6hBX/JxsEKl5up/Y2bsxgVQ=
228228
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
@@ -785,8 +785,8 @@ golang.org/x/exp/typeparams v0.0.0-20260209203927-2842357ff358/go.mod h1:4Mzdyp/
785785
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
786786
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
787787
golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
788-
golang.org/x/image v0.37.0 h1:ZiRjArKI8GwxZOoEtUfhrBtaCN+4b/7709dlT6SSnQA=
789-
golang.org/x/image v0.37.0/go.mod h1:/3f6vaXC+6CEanU4KJxbcUZyEePbyKbaLoDOe4ehFYY=
788+
golang.org/x/image v0.38.0 h1:5l+q+Y9JDC7mBOMjo4/aPhMDcxEptsX+Tt3GgRQRPuE=
789+
golang.org/x/image v0.38.0/go.mod h1:/3f6vaXC+6CEanU4KJxbcUZyEePbyKbaLoDOe4ehFYY=
790790
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
791791
golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
792792
golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=

plan.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import (
1111
graphviz "github.com/goccy/go-graphviz"
1212
)
1313

14+
// Compile-time version compatibility check.
15+
var _ = tracing.SupportPackageIsVersion1
16+
1417
// ErrWTF is the error returned in case we find dependency resolution related errors, please report this
1518
var ErrWTF = errors.New("what a terrible failure: this is likely a bug in dependency resolution, please report this")
1619

0 commit comments

Comments
 (0)