Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 45 for example (0.25 sec)

  1. src/bytes/example_test.go

    cui fliter <******@****.***> 1709194171 +0800
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Mar 04 15:54:40 GMT 2024
    - 15K bytes
    - Viewed (1)
  2. src/bufio/example_test.go

    favonia <******@****.***> 1684978995 -0400
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Mon Oct 23 09:06:30 GMT 2023
    - 4.9K bytes
    - Viewed (0)
  3. src/archive/tar/example_test.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package tar_test
    
    import (
    	"archive/tar"
    	"bytes"
    	"fmt"
    	"io"
    	"log"
    	"os"
    )
    
    func Example_minimal() {
    	// Create and add some files to the archive.
    	var buf bytes.Buffer
    	tw := tar.NewWriter(&buf)
    	var files = []struct {
    		Name, Body string
    	}{
    		{"readme.txt", "This archive contains some text files."},
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Nov 16 16:54:08 GMT 2017
    - 1.4K bytes
    - Viewed (0)
  4. src/archive/zip/example_test.go

    	var files = []struct {
    		Name, Body string
    	}{
    		{"readme.txt", "This archive contains some text files."},
    		{"gopher.txt", "Gopher names:\nGeorge\nGeoffrey\nGonzo"},
    		{"todo.txt", "Get animal handling licence.\nWrite more examples."},
    	}
    	for _, file := range files {
    		f, err := w.Create(file.Name)
    		if err != nil {
    			log.Fatal(err)
    		}
    		_, err = f.Write([]byte(file.Body))
    		if err != nil {
    			log.Fatal(err)
    		}
    	}
    
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Jan 27 00:22:03 GMT 2016
    - 2K bytes
    - Viewed (0)
  5. src/cmd/cgo/internal/swig/testdata/stdio/main.swig

    /* Copyright 2011 The Go Authors. All rights reserved.
       Use of this source code is governed by a BSD-style
       license that can be found in the LICENSE file.  */
    
    /* A trivial example of wrapping a C library using SWIG.  */
    
    %{
    #include <stdio.h>
    #include <stdlib.h>
    %}
    
    %typemap(gotype) const char * "string"
    %typemap(in) const char * %{
    	$1 = malloc($input.n + 1);
    	memcpy($1, $input.p, $input.n);
    	$1[$input.n] = '\0';
    %}
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Fri May 12 12:00:07 GMT 2023
    - 563 bytes
    - Viewed (0)
  6. doc/README.md

    `doc/next/*stdlib/*minor`.
    The files should be in the subdirectory for the package with the new
    API, and should be named after the issue number of the API proposal.
    For example, if the directory `6-stdlib/99-minor` is present,
    then an `api/next` file with the line
    
        pkg net/http, function F #12345
    
    should have a corresponding file named `doc/next/6-stdlib/99-minor/net/http/12345.md`.
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Wed Apr 10 19:41:39 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  7. src/builtin/builtin.go

    //
    //	Slice: The size specifies the length. The capacity of the slice is
    //	equal to its length. A second integer argument may be provided to
    //	specify a different capacity; it must be no smaller than the
    //	length. For example, make([]int, 0, 10) allocates an underlying array
    //	of size 10 and returns a slice of length 0 and capacity 10 that is
    //	backed by this underlying array.
    //	Map: An empty map is allocated with enough space to hold the
    Go
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 12.7K bytes
    - Viewed (0)
  8. doc/go_spec.html

    For instance, this example:
    </p>
    
    <pre>
    	goto L  // BAD
    	v := 3
    L:
    </pre>
    
    <p>
    is erroneous because the jump to label <code>L</code> skips
    the creation of <code>v</code>.
    </p>
    
    <p>
    A "goto" statement outside a <a href="#Blocks">block</a> cannot jump to a label inside that block.
    For instance, this example:
    </p>
    
    <pre>
    if n%2 == 1 {
    HTML
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Apr 11 20:22:45 GMT 2024
    - 279.3K bytes
    - Viewed (0)
  9. doc/godebug.md

    A GODEBUG setting is a `key=value` pair
    that controls the execution of certain parts of a Go program.
    The environment variable `GODEBUG`
    can hold a comma-separated list of these settings.
    For example, if a Go program is running in an environment that contains
    
    	GODEBUG=http2client=0,http2server=0
    
    then that Go program will disable the use of HTTP/2 by default in both
    the HTTP client and the HTTP server.
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Tue Apr 16 17:29:58 GMT 2024
    - 13.5K bytes
    - Viewed (0)
  10. doc/next/6-stdlib/99-minor/net/63116.md

    The [DNSError] type now wraps errors caused by timeouts or cancelation.
    For example, `errors.Is(someDNSErr, context.DeadlineExceedeed)`
    Plain Text
    - Registered: Tue Apr 23 11:13:09 GMT 2024
    - Last Modified: Thu Apr 18 16:00:16 GMT 2024
    - 197 bytes
    - Viewed (0)
Back to top