Skip to content

Commit d69f9b2

Browse files
committed
fix: ensure empty or devel version valid
As we send the version in our ApiVersionsRequest as the ClientSoftwareVersion we need to make sure it is considered valid by Kafka by conforming to their version regex
1 parent 845935f commit d69f9b2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

version.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ func version() string {
1515
bi, ok := debug.ReadBuildInfo()
1616
if ok {
1717
v = bi.Main.Version
18-
} else {
18+
}
19+
if v == "" || v == "(devel)" {
1920
// if we can't read a go module version then they're using a git
2021
// clone or vendored module so all we can do is report "dev" for
21-
// the version
22+
// the version to make a valid ApiVersions request
2223
v = "dev"
2324
}
2425
})

0 commit comments

Comments
 (0)