mirror of
https://github.com/crazy-max/diun.git
synced 2025-12-31 10:07:23 +01:00
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>
42 lines
891 B
Go
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)
|
|
}
|
|
}
|