FFI::Platypus::Type::GoString - Go String type for Platypus
version 0.02
use FFI::Platypus 1.00; my $ffi = FFI::Platypus->new( api => 1 ); $ffi->load_custom_type('::GoString' => 'gostring'); $ffi->function( some_go_function => [ 'gostring' ] )->call("hello there!");
This Platypus custom types lets you pass strings transparently into Go code without having to create/pass FFI::Go::String types manually. Under the covers FFI::Go::String is used.
The Go language plugin FFI::Platypus::Lang::Go will load this custom type automatically, so probably best to just do this:
use FFI::Platypus 1.00; my $ffi = FFI::Platypus->new( api => 1, lang => 'Go' ); $ffi->function( some_go_function => [ 'gostring' ] )->call("hello there!");
Functions that return a string are not supported, as calling such functions outside of Go are not currently supported.
Graham Ollis <plicease@cpan.org>
This software is copyright (c) 2018-2022 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install FFI::Platypus::Lang::Go, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FFI::Platypus::Lang::Go
CPAN shell
perl -MCPAN -e shell install FFI::Platypus::Lang::Go
For more information on module installation, please visit the detailed CPAN module installation guide.