Socket
Socket
Sign inDemoInstall

github.com/Shaked/gomobiledetect

Package Overview
Dependencies
0
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/Shaked/gomobiledetect

Gomobiledetect 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


Version published

Readme

Source

GoMobileDetect

GoDoc Build Status Coverage Status

Description

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.

Installation

$ go get github.com/Shaked/gomobiledetect 

Updates

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{}.

Benchmarking
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

Usage

There are different ways of using the package:

License

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

FAQs

Last updated on 11 Dec 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc