blob: 590329ef84ece706f51764758b1fc0cb5c319176 [file] [log] [blame]
kesavandc71914f2022-03-25 11:19:03 +05301package sarama
2
3import "runtime/debug"
4
5var v string
6
7func version() string {
8 if v == "" {
9 bi, ok := debug.ReadBuildInfo()
10 if ok {
11 v = bi.Main.Version
12 } else {
13 // if we can't read a go module version then they're using a git
14 // clone or vendored module so all we can do is report "dev" for
15 // the version
16 v = "dev"
17 }
18 }
19 return v
20}