Go Mobile Detect is a lightweight Go package imported from PHP for detecting mobile devices (including tablets). It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment
Clone or download
Shaked Merge pull request #14 from guessi/import-mobile-detect-2.8.28
Import from upstream Mobile-Detect (2.8.29)
Latest commit 25f014f Dec 11, 2017



GoDoc Build Status Coverage Status


GoMobileDetect is a lightweight package imported from PHP for detecting mobile devices including tablets.

The package is imported from MobileDetect which was originally written in PHP.


$ go get github.com/Shaked/gomobiledetect 


Version 1.2.0

  • Now supports using Http.Handler implementation. See examples

Version 1.0.0

  • The package name had been changed to mobiledetect.

Version 0.2.0

  • This version introduces a new method IsKey(key int). This method is faster than the Is(key string). All keys can be found here

  • The Is(key string) has been changed to support both string and int using the interface{}.


Version 0.1.2
BenchmarkIsMobile       2000       1001884 ns/op
ok      github.com/Shaked/gomobiledetect    7.091s
Version 0.2.0
BenchmarkIsMobile     100000         19278 ns/op
ok      github.com/Shaked/gomobiledetect    7.448s


There are different ways of using the package:


Go Mobile Detect is an open-source script released under MIT License.