Files
diun/vendor/maunium.net/go/mautrix/version.go
dependabot[bot] 0a38785f4a chore(deps): bump maunium.net/go/mautrix from 0.25.2 to 0.26.1
Bumps [maunium.net/go/mautrix](https://github.com/mautrix/go) from 0.25.2 to 0.26.1.
- [Release notes](https://github.com/mautrix/go/releases)
- [Changelog](https://github.com/mautrix/go/blob/main/CHANGELOG.md)
- [Commits](https://github.com/mautrix/go/compare/v0.25.2...v0.26.1)

---
updated-dependencies:
- dependency-name: maunium.net/go/mautrix
  dependency-version: 0.26.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-23 01:01:56 +00:00

42 lines
891 B
Go

package mautrix
import (
"fmt"
"regexp"
"runtime"
"runtime/debug"
"strings"
)
const Version = "v0.26.1"
var GoModVersion = ""
var Commit = ""
var VersionWithCommit = Version
var DefaultUserAgent = "mautrix-go/" + Version + " go/" + strings.TrimPrefix(runtime.Version(), "go")
func init() {
if GoModVersion == "" {
info, _ := debug.ReadBuildInfo()
if info != nil {
for _, mod := range info.Deps {
if mod.Path == "maunium.net/go/mautrix" {
GoModVersion = mod.Version
break
}
}
}
}
if GoModVersion != "" {
match := regexp.MustCompile(`v.+\d{14}-([0-9a-f]{12})`).FindStringSubmatch(GoModVersion)
if match != nil {
Commit = match[1]
}
}
if Commit != "" {
VersionWithCommit = fmt.Sprintf("%s+dev.%s", Version, Commit[:8])
DefaultUserAgent = strings.Replace(DefaultUserAgent, "mautrix-go/"+Version, "mautrix-go/"+VersionWithCommit, 1)
}
}