bindgo 0.1.2
bindgo: ^0.1.2 copied to clipboard
Use Dart to call Shell, complete the work of compiling Golang CGO code into a so, dll, a, WASM, and etc. And place it in the corresponding source file directory of each Flutter platform.
BindGo #
Getting started #
First, add bindgo as a dev dependency in your pubspec.yaml file. It belongs in dev_dependencies because it is a command line tool.
dev_dependencies:
bindgo: any
Usage #
- Adding your config to field
bindgoin pubspec.yaml
e.g. :
bindgo:
name: test # Dynamic library output name
main: ./test # The directory where the main package of golang code is located
platforms:
windows:
arch:
- 'amd64'
android:
arch:
- 'arm64'
cc: 'C:NDK\toolchains\llvm\prebuilt\windows-x86_64\bin\aarch64-linux-android27-clang.cmd'
- Run the following command in the terminal
flutter pub run bindgo:run
Additional information #
View the operating systems and architectures supported by the current version of golang:
go tool dist list
It will output:
e.g. :