summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--caddy.go22
1 files changed, 15 insertions, 7 deletions
diff --git a/caddy.go b/caddy.go
index 1ecad94..5d0152a 100644
--- a/caddy.go
+++ b/caddy.go
@@ -864,13 +864,21 @@ func Version() (simple, full string) {
// bi.Main... hopefully.
var module *debug.Module
bi, ok := debug.ReadBuildInfo()
- if ok {
- // find the Caddy module in the dependency list
- for _, dep := range bi.Deps {
- if dep.Path == ImportPath {
- module = dep
- break
- }
+ if !ok {
+ if CustomVersion != "" {
+ full = CustomVersion
+ simple = CustomVersion
+ return
+ }
+ full = "unknown"
+ simple = "unknown"
+ return
+ }
+ // find the Caddy module in the dependency list
+ for _, dep := range bi.Deps {
+ if dep.Path == ImportPath {
+ module = dep
+ break
}
}
if module != nil {