Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 14 for 2014 (0.03 sec)

  1. src/sync/example_test.go

    // Copyright 2012 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.
    
    package sync_test
    
    import (
    	"fmt"
    	"os"
    	"sync"
    )
    
    type httpPkg struct{}
    
    func (httpPkg) Get(url string) {}
    
    var http httpPkg
    
    // This example fetches several URLs concurrently,
    // using a WaitGroup to block until all the fetches are complete.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 23 17:45:47 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  2. src/os/exec/example_test.go

    // Copyright 2012 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.
    
    package exec_test
    
    import (
    	"context"
    	"encoding/json"
    	"fmt"
    	"io"
    	"log"
    	"os"
    	"os/exec"
    	"strings"
    	"time"
    )
    
    func ExampleLookPath() {
    	path, err := exec.LookPath("fortune")
    	if err != nil {
    		log.Fatal("installing fortune is in your future")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 07 06:18:48 UTC 2022
    - 3.5K bytes
    - Viewed (0)
  3. src/strings/example_test.go

    // Copyright 2012 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.
    
    package strings_test
    
    import (
    	"fmt"
    	"strings"
    	"unicode"
    	"unsafe"
    )
    
    func ExampleClone() {
    	s := "abc"
    	clone := strings.Clone(s)
    	fmt.Println(s == clone)
    	fmt.Println(unsafe.StringData(s) == unsafe.StringData(clone))
    	// Output:
    	// true
    	// false
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 09 22:05:38 UTC 2023
    - 10.7K bytes
    - Viewed (0)
  4. src/time/example_test.go

    	// Unix format: Wed Feb 25 11:06:39 PST 2015
    	// Same, in UTC: Wed Feb 25 19:06:39 UTC 2015
    	//in Shanghai with seconds: 2015-02-26T03:06:39 +080000
    	//in Shanghai with colon seconds: 2015-02-26T03:06:39 +08:00:00
    	//
    	// Formats:
    	//
    	// Basic full date  "Mon Jan 2 15:04:05 MST 2006" gives "Wed Feb 25 11:06:39 PST 2015"
    	// Basic short date "2006/01/02" gives "2015/02/25"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 13 01:05:00 UTC 2024
    - 22.4K bytes
    - Viewed (0)
  5. src/math/rand/example_test.go

    // Copyright 2012 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.
    
    package rand_test
    
    import (
    	"fmt"
    	"math/rand"
    	"os"
    	"strings"
    	"text/tabwriter"
    )
    
    // These tests serve as an example but also make sure we don't change
    // the output of the random number generator when given a fixed seed.
    
    func Example() {
    	answers := []string{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 26 16:24:57 UTC 2022
    - 4.2K bytes
    - Viewed (0)
  6. src/crypto/tls/example_test.go

    // Copyright 2014 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.
    
    package tls_test
    
    import (
    	"crypto/tls"
    	"crypto/x509"
    	"log"
    	"net/http"
    	"net/http/httptest"
    	"os"
    	"time"
    )
    
    // zeroSource is an io.Reader that returns an unlimited number of zero bytes.
    type zeroSource struct{}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 27 18:23:49 UTC 2024
    - 7.8K bytes
    - Viewed (0)
  7. src/go/scanner/example_test.go

    // Copyright 2012 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.
    
    package scanner_test
    
    import (
    	"fmt"
    	"go/scanner"
    	"go/token"
    )
    
    func ExampleScanner_Scan() {
    	// src is the input that we want to tokenize.
    	src := []byte("cos(x) + 1i*sin(x) // Euler")
    
    	// Initialize the scanner.
    	var s scanner.Scanner
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 27 19:47:49 UTC 2022
    - 1K bytes
    - Viewed (0)
  8. src/go/printer/example_test.go

    // Copyright 2012 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.
    
    package printer_test
    
    import (
    	"bytes"
    	"fmt"
    	"go/ast"
    	"go/parser"
    	"go/printer"
    	"go/token"
    	"strings"
    )
    
    func parseFunc(filename, functionname string) (fun *ast.FuncDecl, fset *token.FileSet) {
    	fset = token.NewFileSet()
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 16 14:55:02 UTC 2022
    - 1.7K bytes
    - Viewed (0)
  9. src/io/example_test.go

    // Copyright 2015 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.
    
    package io_test
    
    import (
    	"fmt"
    	"io"
    	"log"
    	"os"
    	"strings"
    )
    
    func ExampleCopy() {
    	r := strings.NewReader("some io.Reader stream to be read\n")
    
    	if _, err := io.Copy(os.Stdout, r); err != nil {
    		log.Fatal(err)
    	}
    
    	// Output:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 06 15:49:32 UTC 2022
    - 5.5K bytes
    - Viewed (0)
  10. src/regexp/example_test.go

    // Copyright 2013 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.
    
    package regexp_test
    
    import (
    	"fmt"
    	"regexp"
    	"strings"
    )
    
    func Example() {
    	// Compile the expression once, usually at init time.
    	// Use raw strings to avoid having to quote the backslashes.
    	var validID = regexp.MustCompile(`^[a-z]+\[[0-9]+\]$`)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 07 00:22:53 UTC 2023
    - 11.1K bytes
    - Viewed (0)
Back to top