From 112368a2e39a89c4d3a3f4229a5b8b8bf91b17a7 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Sat, 13 Jul 2019 13:27:02 +0200 Subject: [PATCH] ui/app: add a DataDir fallback to Go 1.12 o.UserConfigDir is introduced in Go 1.13, which is not released yet. Add a Go 1.12 stopgab until then. Signed-off-by: Elias Naur --- ui/app/datadir.go | 2 +- ui/app/datadir_go112.go | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 ui/app/datadir_go112.go diff --git a/ui/app/datadir.go b/ui/app/datadir.go index 31e5453f..1283e6b9 100644 --- a/ui/app/datadir.go +++ b/ui/app/datadir.go @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Unlicense OR MIT -// +build !android +// +build !android,go1.13 package app diff --git a/ui/app/datadir_go112.go b/ui/app/datadir_go112.go new file mode 100644 index 00000000..4aeaaf93 --- /dev/null +++ b/ui/app/datadir_go112.go @@ -0,0 +1,12 @@ +// SPDX-License-Identifier: Unlicense OR MIT + +// +build !android,!go1.13 + +package app + +import "os" + +func dataDir() (string, error) { + // Use a quick workaround until we can require go 1.13. + return os.UserHomeDir() +}