Socket
Socket
Sign inDemoInstall

github.com/hindsights/mobile

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/hindsights/mobile


Version published
Created
Source

A gomobile fork compatible with Go-Module

Gomobile generates code in a temporary directory(/tmp/gomobile-work-xxxx) outside current project, so the generated code can't import go packages from project not under GOPATH.

To add support for Go Module, a simple and temporary solution is to generate wrapper code inside current project, let the generated code be a part of the project, so packages can be referenced correctly.

Modifications

  1. Add flag '-outdir' in gomobile and pass it to godind
  2. Gobind generates wrapper code in 'outdir', not in 'outdir/src/gobind'
  3. Invoke go build for code generated by gobind without modified GOPATH env
  4. Use pkg.Types as type package, remove imp.Import, because imp.Import failed with Go Module, and also it is extremely slow on my MacBook Pro.
  5. Reserve contents in 'outdir', for ease of diagnoisis

RISK

This program is not tested extensively, and only 'gomobile bind' is tested, other commands may not work, you should use it with care.

FAQs

Package last updated on 18 Oct 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc