aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/version/debugging_linux.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-05-01 11:14:12 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-05-01 11:14:12 +0200
commit2e4f8e31dad639e9e40b29552380d5ca4629d1bd (patch)
treeec8573073bf68253267ed741b60bf23b8e4554a3 /version/debugging_linux.go
parentui: support clipboard copying for log items (diff)
downloadwireguard-windows-2e4f8e31dad639e9e40b29552380d5ca4629d1bd.tar.xz
wireguard-windows-2e4f8e31dad639e9e40b29552380d5ca4629d1bd.zip
version: dynamically get file version
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'version/debugging_linux.go')
-rw-r--r--version/debugging_linux.go32
1 files changed, 32 insertions, 0 deletions
diff --git a/version/debugging_linux.go b/version/debugging_linux.go
new file mode 100644
index 00000000..df5dbd2f
--- /dev/null
+++ b/version/debugging_linux.go
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: MIT
+ *
+ * Copyright (C) 2019 WireGuard LLC. All Rights Reserved.
+ */
+
+package version
+
+// For testing the updater package from linux. Debug stuff only.
+
+func IsOfficialPath(path string) bool {
+ return true
+}
+
+func utsToStr(u [65]byte) string {
+ i := bytes.IndexByte(u[:], 0)
+ if i < 0 {
+ return string(u[:])
+ }
+ return string(u[:i])
+}
+
+func OsName() string {
+ var utsname unix.Utsname
+ if unix.Uname(&utsname) != nil {
+ return "Unix Unknown"
+ }
+ return fmt.Sprintf("%s %s %s", utsToStr(utsname.Sysname), utsToStr(utsname.Release), utsToStr(utsname.Version))
+}
+
+func RunningVersion() string {
+ return "0.0.0.0"
+}