Commit graph

39 commits

Author SHA1 Message Date
William S Fulton
c10a84c775 Cosmetic stray semi-colon removal after %typemap using quotes 2022-08-31 19:40:13 +01:00
Corey Minyard
546763ffbc [Go] Add an example for goin and godirectorin
Shows how to use a go directory for passing an NULL terminated argv type
array.

This also exercises the bug in the previous commit.  That's why the
call1 function isn't assigned to zero, that the only case where that bug
happens.

Signed-off-by: Corey Minyard <cminyard@mvista.com>
2022-04-18 19:55:34 -05:00
Ian Lance Taylor
7aafe3d8b2 Fix all Go tests to build with "go build"
Tested against Go 1.6 through Go 1.13beta1, and gccgo.

Fixes #1607
2019-08-08 14:30:50 -07:00
Ian Lance Taylor
8a1c09e280 Fix Go tests to run in module mode
Stop using relative imports and add a go.mod file.

Tested against Go 1.6 through Go pre-1.13, and gccgo.
2019-04-24 21:43:38 -07:00
luz.paz
60dfa31a67 Misc. typos
found via `codespell` and `grep`
2018-05-17 10:04:23 -04:00
Fabrice Benhamouda
5386bf2a24 fix swig/swig#600 and fix swig/swig#955 2017-06-17 11:38:07 +12:00
William S Fulton
8e2bc595c6 Remove use of preinst-swig script
Complete the prototype removal in ca1431.

The script prevents SWIGTOOL=gdb from working as gdb can't be used to
debug a shell script, it requires a binary.

Add support for SWIGTOOL in all the examples.

SWIG_LIB_DIR and SWIGEXE must now instead be set by all Makefiles.

See issue #473.
2015-08-21 22:43:17 +01:00
Michael Schaller
608ef60ecf [Go] Renamed 'FooBarAbs' to 'FooBarAbstract' in the documentation and examples. 2015-08-09 14:37:16 +02:00
Michael Schaller
85037c3a33 [Go] Updated the 'callback' and 'extend' examples to match the 'director' one.
After the documentation update on how to utilize the director feature with
commit @17b1c1c the 'callback' and 'extend' examples needed an update as well.
2015-08-09 14:37:16 +02:00
Michael Schaller
a941e5b605 [Go] Revert commit 5e88857 to undelete the 'callback' and 'extend' examples.
The 'callback' and 'extend' examples were presumed to be obsoleted by the new
'director' example.  The examples are helpful though to have similar examples
across target languages and hence the commit @5e88857 which removed these
examples got reverted.
2015-08-09 14:36:58 +02:00
Ian Lance Taylor
95a08b3950 [Go] update build instructions in Examples/go/index.html 2015-08-05 07:19:05 -07:00
Michael Schaller
736613e26c [Go] Documentation cleanup of obsolete 'callback' and 'extend' examples.
After commit 17b1c1c (pull request 447; issue 418) the 'callback' and 'extend'
examples have been removed in favor of the 'director' example.
2015-08-05 10:01:15 +02:00
Michael Schaller
d9d26149e7 Some minor changes after first code review by ianlancetaylor.
Renamed overwritenMethodsOnFooBarAbs to overwrittenMethodsOnFooBarAbs.
Changed some line breaks.
2015-08-04 09:50:56 +02:00
Michael Schaller
e47d87e404 Fixed Examples/go/director/Makefile as there might be no copy of director.go during clean if a separate build directory is in use. 2015-08-04 09:34:26 +02:00
Michael Schaller
0db9a6ba7b Fixed Examples/go/director/Makefile as the copy of director.go wasn't cleaned up in separate build directories. 2015-08-04 09:34:26 +02:00
Michael Schaller
afd6a55ce1 Fixed Examples/go/director/Makefile as director.go was missing in separate build directories. 2015-08-04 09:34:26 +02:00
Michael Schaller
a17c9727bd Fleshed out Go's documentation about the director feature and added a director example.
Fixes issues #418.
2015-08-04 09:34:26 +02:00
William S Fulton
b4c441f62e Remove unused std_string.i from callback examples 2015-05-10 11:49:28 +01:00
Ian Lance Taylor
e044dc4405 [Go] Fix Go multimap example to use Swig_AllocateString and swigCopyString. 2015-05-04 17:16:44 -07:00
Olly Betts
ac1f067ce9 Eliminate trivial differences between the reference examples 2014-11-07 15:34:43 +13:00
Olly Betts
37cd1474b5 Remove bogus ; after } in examples 2014-11-07 15:34:43 +13:00
William S Fulton
f39ed94419 Fix compiler warnings in examples when using -std=c++98 -std=gnu89 -pedantic -Wreturn-type 2014-05-24 13:13:32 +01:00
Karl Wette
f574a34155 Allow examples and test-suite to be built out of source tree
- Examples/Makefile.in rules use SRCDIR as the relative source directory

- ./config.status replicates Examples/ source directory tree in build
  directory, and copies each Makefile to build directory, prefixed with
  a header which sets SRCDIR to source directory

- Examples/test-suite/.../Makefile.in set SRCDIR from Autoconf-set srcdir

- Examples/test-suite/errors/Makefile.in needs to filter out source
  directory from SWIG error messages

- Lua: embedded interpreters are passed location of run-time test

- Python: copy run-time scripts to build directory because of 2to3
  conversion; import_packages example copies __init__.py from source
  directory; test-suite sets SCRIPTDIR to location of run-time tests

- Javascript: binding.gyp renamed to binding.gyp.in so that $srcdir
  can be substituted with SRCDIR; removed './' from require() statements
  so that NODE_PATH can be used to point Node.js to build directory
2014-05-11 23:21:10 +02:00
Olly Betts
b115c984a9 More cleaning up of the class examples 2014-05-05 16:14:31 +12:00
Karl Wette
3aacde4f5f Whitespace cleanup of Example Makefiles 2014-04-16 12:06:02 +02:00
Olly Betts
0de4cf13a8 Further cleaning up of class examples 2014-02-24 10:10:24 +13:00
Olly Betts
2f3bf144c6 Fix assorted comment and documentation typos 2014-02-23 17:15:22 +13:00
Ian Lance Taylor
01ebdc0995 In Examples/Makefile.in, compile and link the program in go and
go_cpp, rather than in go_run.  This permits eliminating go_run_cpp.
2013-12-20 08:14:45 -08:00
Ian Lance Taylor
1dca0af024 Update for Go 1.2 release. Add support for linking SWIG code directly
into executable, rather than using a shared library.
2013-12-16 19:50:17 -08:00
William S Fulton
152905e193 Fix gcc -Waddress warning in variables examples 2013-10-18 06:53:02 +01:00
Olly Betts
12708c9241 Fix typos 2013-09-25 17:29:33 +12:00
William S Fulton
112d7aa6d0 Go examples and test-suite format fixes
Patch has the results of find . -name *.go -exec gofmt -w {} \;

SF Patch #339.
2013-07-01 20:13:36 +01:00
William S Fulton
6acfda55d1 Go examples makefiles clean target fixed and use RUNPIPE and tidyup 2013-04-19 22:47:25 +01:00
Ian Lance Taylor
e82f320510 Run gofmt on hand written Go code.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12781 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-08-22 20:04:06 +00:00
Ian Lance Taylor
7ac265ff3d For Go: Fix handling of INPUT variables when using typemaps.i. This
fixes cases where the gotype typemap is used to produce a simple Go
type for a non-simple C/C++ type.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12498 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2011-02-20 05:48:25 +00:00
William S Fulton
b89248404d Remove generated files from svn for Go examples
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12316 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-11-26 20:32:23 +00:00
Ian Lance Taylor
683dafb6d3 Update the instructions to say that you also need to compile the code
itself.


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12133 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-16 15:47:15 +00:00
Ian Lance Taylor
da5e02f81c Rename "go" typemap to "gotype".
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12129 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-15 19:40:34 +00:00
Ian Lance Taylor
5af2978f77 Add support for the Go programming language.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12108 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2010-06-10 01:13:31 +00:00