- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 23 for calling (0.56 sec)
-
src/cmd/cgo/internal/test/callback_c_gc.c
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. //go:build gc #include "_cgo_export.h" #include <stdint.h> #include <stdio.h> #include <stdlib.h> /* Test calling panic from C. This is what SWIG does. */ extern void crosscall2(void (*fn)(void *, int), void *, int); extern void _cgo_panic(void *, int); extern void _cgo_allocate(void *, int); void callPanic(void) {
C - Registered: Tue Apr 23 11:13:09 GMT 2024 - Last Modified: Fri May 12 12:00:02 GMT 2023 - 592 bytes - Viewed (0) -
src/cmd/cgo/doc.go
In C, a function argument written as a fixed size array actually requires a pointer to the first element of the array. C compilers are aware of this calling convention and adjust the call accordingly, but Go cannot. In Go, you must pass the pointer to the first element explicitly: C.f(&C.x[0]). Calling variadic C functions is not supported. It is possible to circumvent this by using a C function wrapper. For example: package main
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Sun Mar 31 09:02:45 GMT 2024 - 42.1K bytes - Viewed (0) -
src/cmd/cgo/ast.go
ctxFile ctxDecl ctxSpec ctxDefer ctxCall // any function call other than ctxCall2 ctxCall2 // function call whose result is assigned to two variables ctxSelector ) // walk walks the AST x, calling visit(f, x, context) for each node. func (f *File) walk(x interface{}, context astContext, visit func(*File, interface{}, astContext)) { visit(f, x, context) switch n := x.(type) { case *ast.Expr:
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Wed Jun 07 16:54:27 GMT 2023 - 14.3K bytes - Viewed (0) -
src/bytes/buffer_test.go
check(t, testname+" (fill 4)", buf, s) } return s } func TestNewBuffer(t *testing.T) { buf := NewBuffer(testBytes) check(t, "NewBuffer", buf, testString) } var buf Buffer // Calling NewBuffer and immediately shallow copying the Buffer struct // should not result in any allocations. // This can be used to reset the underlying []byte of an existing Buffer. func TestNewBufferShallow(t *testing.T) {
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Fri Apr 26 13:31:36 GMT 2024 - 18.6K bytes - Viewed (0) -
src/cmd/cgo/internal/test/callback_c_gccgo.c
// license that can be found in the LICENSE file. //go:build gccgo #include "_cgo_export.h" #include <stdint.h> #include <stdio.h> #include <stdlib.h> /* Test calling panic from C. This is what SWIG does. */ extern void _cgo_panic(const char *); extern void *_cgo_allocate(size_t); void callPanic(void) { _cgo_panic("panic from C");
C - Registered: Tue Apr 23 11:13:09 GMT 2024 - Last Modified: Fri May 12 12:00:02 GMT 2023 - 452 bytes - Viewed (0) -
src/bufio/bufio_test.go
{"byte", iotest.OneByteReader}, {"half", iotest.HalfReader}, {"data+err", iotest.DataErrReader}, {"timeout", iotest.TimeoutReader}, } // Call ReadString (which ends up calling everything else) // to accumulate the text of a file. func readLines(b *Reader) string { s := "" for { s1, err := b.ReadString('\n') if err == io.EOF { break }
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Fri Feb 10 18:56:01 GMT 2023 - 51.5K bytes - Viewed (0) -
src/cmd/cgo/internal/test/issue20910.c
// Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. #include <assert.h> #include <stdlib.h> #include <string.h> #include "_cgo_export.h" /* Test calling a Go function with multiple return values. */ void callMulti(void) { struct multi_return result = multi(); assert(strcmp(result.r0, "multi") == 0); assert(result.r1 == 0); free(result.r0);
C - Registered: Tue Apr 23 11:13:09 GMT 2024 - Last Modified: Fri May 12 12:00:02 GMT 2023 - 459 bytes - Viewed (0) -
doc/go1.17_spec.html
or, for function parameters and results, the signature of a <a href="#Function_declarations">function declaration</a> or <a href="#Function_literals">function literal</a> reserves storage for a named variable. Calling the built-in function <a href="#Allocation"><code>new</code></a> or taking the address of a <a href="#Composite_literals">composite literal</a> allocates storage for a variable at run time.
HTML - Registered: Tue May 07 11:14:38 GMT 2024 - Last Modified: Thu Apr 11 20:22:45 GMT 2024 - 211.6K bytes - Viewed (0) -
src/archive/zip/reader_test.go
} } func TestCVE202139293(t *testing.T) { // directory size is so large, that the check in Reader.init // overflows when subtracting from the archive size, causing // the pre-allocation check to be bypassed. data := []byte{ 0x50, 0x4b, 0x06, 0x06, 0x05, 0x06, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x4b,
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Wed Mar 27 18:23:49 GMT 2024 - 55.3K bytes - Viewed (0) -
src/archive/zip/reader.go
type ReadCloser struct { f *os.File Reader } // A File is a single file in a ZIP archive. // The file information is in the embedded [FileHeader]. // The file content can be accessed by calling [File.Open]. type File struct { FileHeader zip *Reader zipr io.ReaderAt headerOffset int64 // includes overall ZIP archive baseOffset
Go - Registered: Tue Apr 30 11:13:12 GMT 2024 - Last Modified: Fri Oct 13 18:36:46 GMT 2023 - 27.7K bytes - Viewed (0)