diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-01-28 17:20:40 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2021-02-01 16:55:02 +0100 |
commit | 7357c40796ba4223f92d99afd7e680aa53a46d1b (patch) | |
tree | b3a92077444048a6157943e5c5517b21162576cb | |
parent | build: use go 1.16rc1 (diff) | |
download | wireguard-windows-7357c40796ba4223f92d99afd7e680aa53a46d1b.tar.xz wireguard-windows-7357c40796ba4223f92d99afd7e680aa53a46d1b.zip |
version: stop using go version tags in repo
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | go.sum | 4 | ||||
-rw-r--r-- | ui/aboutdialog.go | 4 | ||||
-rw-r--r-- | version/protocol.go | 28 |
4 files changed, 33 insertions, 5 deletions
@@ -9,7 +9,7 @@ require ( golang.org/x/net v0.0.0-20210119194325-5f4716e94777 golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c golang.org/x/text v0.3.5 - golang.zx2c4.com/wireguard v0.0.20201119-0.20210128142622-6a128dde71d9 + golang.zx2c4.com/wireguard v0.0.0-20210128162339-bf3bb888512e ) replace ( @@ -20,8 +20,8 @@ golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e h1:FDhOuMEY4JVRztM/gsbk+IKUQ8kj74bxZrgw87eMMVc= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.zx2c4.com/wireguard v0.0.20201119-0.20210128142622-6a128dde71d9 h1:9qTywLj02s2UQn7z8++V8sFSXblOg+Uc8vDA7MM6rwk= -golang.zx2c4.com/wireguard v0.0.20201119-0.20210128142622-6a128dde71d9/go.mod h1:r0ExowOoGFfDoLDxx+M9SYbNVsoZ0xviLL+K4f2mt+A= +golang.zx2c4.com/wireguard v0.0.0-20210128162339-bf3bb888512e h1:l1b5JcJtTQvleon/yyzRy3q7FltfkVrQL7SPdxj5KXI= +golang.zx2c4.com/wireguard v0.0.0-20210128162339-bf3bb888512e/go.mod h1:r0ExowOoGFfDoLDxx+M9SYbNVsoZ0xviLL+K4f2mt+A= golang.zx2c4.com/wireguard/windows v0.0.0-20201107183008-659a4e955570 h1:sbXpfRwl+7YQY72KBuzyacG7ucr6w4OueJiEb7+pvSk= golang.zx2c4.com/wireguard/windows v0.0.0-20201107183008-659a4e955570/go.mod h1:KxxjdtRkfNoYDCUP5ryK7XJJNTnpC8atvtmTheChOtk= golang.zx2c4.com/wireguard/windows v0.0.0-20210121140954-e7fc19d483bd h1:kAUzMAITME2MCtrXBaUa9P4tndiXGWO674k9gn6ZR28= diff --git a/ui/aboutdialog.go b/ui/aboutdialog.go index 19fe02e9..cb05b5f4 100644 --- a/ui/aboutdialog.go +++ b/ui/aboutdialog.go @@ -12,7 +12,7 @@ import ( "github.com/lxn/walk" "github.com/lxn/win" "golang.org/x/sys/windows" - "golang.zx2c4.com/wireguard/device" + "golang.zx2c4.com/wireguard/windows/l18n" "golang.zx2c4.com/wireguard/windows/version" ) @@ -95,7 +95,7 @@ func runAboutDialog(owner walk.Form) error { return err } detailsLbl.SetTextAlignment(walk.AlignHCenterVNear) - detailsLbl.SetText(l18n.Sprintf("App version: %s\nGo backend version: %s\nGo version: %s-%s\nOperating system: %s\nArchitecture: %s", version.Number, device.WireGuardGoVersion, strings.TrimPrefix(runtime.Version(), "go"), runtime.GOARCH, version.OsName(), version.NativeArch())) + detailsLbl.SetText(l18n.Sprintf("App version: %s\nGo backend version: %s\nGo version: %s-%s\nOperating system: %s\nArchitecture: %s", version.Number, version.ProtoImplementation(), strings.TrimPrefix(runtime.Version(), "go"), runtime.GOARCH, version.OsName(), version.NativeArch())) copyrightLbl, err := walk.NewTextLabel(showingAboutDialog) if err != nil { diff --git a/version/protocol.go b/version/protocol.go new file mode 100644 index 00000000..72a35e95 --- /dev/null +++ b/version/protocol.go @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: MIT + * + * Copyright (C) 2019-2021 WireGuard LLC. All Rights Reserved. + */ + +package version + +import ( + "runtime/debug" + "strings" +) + +func ProtoImplementation() string { + info, ok := debug.ReadBuildInfo() + if !ok { + return "unknown" + } + for _, dep := range info.Deps { + if dep.Path == "golang.zx2c4.com/wireguard" { + parts := strings.Split(dep.Version, "-") + if len(parts) == 3 && len(parts[2]) == 12 { + return parts[2][:7] + } + return dep.Version + } + } + return "unknown" +} |