| 1 | package internalscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal`/ |
| 2 | |
| 3 | import ( |
| 4 | "runtime/debugscip-go gomod github.com/golang/go/src go1.25 `runtime/debug`/" |
| 5 | "stringsscip-go gomod github.com/golang/go/src go1.25 strings/" |
| 6 | ) |
| 7 | |
| 8 | // Version represents the current version of dasel. |
| 9 | // The real version number is injected at build time using ldflags. |
| 10 | var Versionscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal`/Version. = "development" |
| 11 | |
| 12 | func initscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal`/init().() { |
| 13 | // Version is set by ldflags on build. |
| 14 | if Versionscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal`/Version. != "development" { |
| 15 | // Strip the "v" prefix to normalize version output across build methods. |
| 16 | // The Dockerfile passes the raw git tag (e.g. "v3.10.1") while Homebrew |
| 17 | // passes the bare semver (e.g. "3.10.1"). |
| 18 | Versionscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal`/Version. = stringsscip-go gomod github.com/golang/go/src go1.25 strings/.TrimPrefixscip-go gomod github.com/golang/go/src go1.25 strings/TrimPrefix().(Versionscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal`/Version., "v") |
| 19 | return |
| 20 | } |
| 21 | |
| 22 | info, ok := debugscip-go gomod github.com/golang/go/src go1.25 `runtime/debug`/.ReadBuildInfoscip-go gomod github.com/golang/go/src go1.25 `runtime/debug`/ReadBuildInfo().() |
| 23 | if !ok { |
| 24 | return |
| 25 | } |
| 26 | |
| 27 | // https://github.com/golang/go/issues/29228 |
| 28 | if info.Mainscip-go gomod github.com/golang/go/src go1.25 `runtime/debug`/BuildInfo#Main..Versionscip-go gomod github.com/golang/go/src go1.25 `runtime/debug`/Module#Version. == "(devel)" || info.Mainscip-go gomod github.com/golang/go/src go1.25 `runtime/debug`/BuildInfo#Main..Versionscip-go gomod github.com/golang/go/src go1.25 `runtime/debug`/Module#Version. == "" { |
| 29 | return |
| 30 | } |
| 31 | |
| 32 | Versionscip-go gomod github.com/tomwright/dasel/v3 . `github.com/tomwright/dasel/v3/internal`/Version. += "-" + info.Mainscip-go gomod github.com/golang/go/src go1.25 `runtime/debug`/BuildInfo#Main..Versionscip-go gomod github.com/golang/go/src go1.25 `runtime/debug`/Module#Version. |
| 33 | } |