From 5d8c39028cf6cc0edacb885726ebbe30b48abf65 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 21 Nov 2020 01:32:51 +0900 Subject: [PATCH] web: Remove unused functions --- internal/web/web_js.go | 13 ++----------- internal/web/web_notjs.go | 8 -------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/internal/web/web_js.go b/internal/web/web_js.go index 74730e7aa..149074165 100644 --- a/internal/web/web_js.go +++ b/internal/web/web_js.go @@ -24,25 +24,16 @@ func IsBrowser() bool { } var ( - userAgent = js.Global().Get("navigator").Get("userAgent").String() - isIOSSafari bool isAndroidChrome bool ) func init() { + userAgent := js.Global().Get("navigator").Get("userAgent").String() isIOSSafari = strings.Contains(userAgent, "iPhone") || strings.Contains(userAgent, "iPad") isAndroidChrome = strings.Contains(userAgent, "Android") && strings.Contains(userAgent, "Chrome") } -func IsIOSSafari() bool { - return isIOSSafari -} - -func IsAndroidChrome() bool { - return isAndroidChrome -} - func IsMobileBrowser() bool { - return IsIOSSafari() || IsAndroidChrome() + return isIOSSafari || isAndroidChrome } diff --git a/internal/web/web_notjs.go b/internal/web/web_notjs.go index 65fd6cd89..bdd483258 100644 --- a/internal/web/web_notjs.go +++ b/internal/web/web_notjs.go @@ -20,14 +20,6 @@ func IsBrowser() bool { return false } -func IsIOSSafari() bool { - return false -} - -func IsAndroidChrome() bool { - return false -} - func IsMobileBrowser() bool { return false }