Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 43 for 2014 (0.12 sec)

  1. 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)
  2. src/crypto/rand/example_test.go

    // 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.
    
    package rand_test
    
    import (
    	"bytes"
    	"crypto/rand"
    	"fmt"
    )
    
    // This example reads 10 cryptographically secure pseudorandom numbers from
    // rand.Reader and writes them to a byte slice.
    func ExampleRead() {
    	c := 10
    	b := make([]byte, c)
    	_, err := rand.Read(b)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 23:34:33 UTC 2016
    - 621 bytes
    - Viewed (0)
  3. src/go/parser/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 parser_test
    
    import (
    	"fmt"
    	"go/parser"
    	"go/token"
    )
    
    func ExampleParseFile() {
    	fset := token.NewFileSet() // positions are relative to fset
    
    	src := `package foo
    
    import (
    	"fmt"
    	"time"
    )
    
    func bar() {
    	fmt.Println(time.Now())
    }`
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 03 16:07:09 UTC 2017
    - 715 bytes
    - Viewed (0)
  4. src/hash/crc32/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 crc32_test
    
    import (
    	"fmt"
    	"hash/crc32"
    )
    
    func ExampleMakeTable() {
    	// In this package, the CRC polynomial is represented in reversed notation,
    	// or LSB-first representation.
    	//
    	// LSB-first representation is a hexadecimal number with n bits, in which the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 04 00:19:22 UTC 2015
    - 1K bytes
    - Viewed (0)
  5. src/archive/tar/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 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
    	}{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 16 16:54:08 UTC 2017
    - 1.4K bytes
    - Viewed (0)
  6. src/errors/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 errors_test
    
    import (
    	"errors"
    	"fmt"
    	"io/fs"
    	"os"
    	"time"
    )
    
    // MyError is an error implementation that includes a time and message.
    type MyError struct {
    	When time.Time
    	What string
    }
    
    func (e MyError) Error() string {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 16 02:08:40 UTC 2023
    - 2.2K bytes
    - Viewed (0)
  7. src/text/template/example_test.go

    // 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.
    
    package template_test
    
    import (
    	"log"
    	"os"
    	"strings"
    	"text/template"
    )
    
    func ExampleTemplate() {
    	// Define a template.
    	const letter = `
    Dear {{.Name}},
    {{if .Attended}}
    It was a pleasure to see you at the wedding.
    {{- else}}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 29 00:17:40 UTC 2015
    - 2.4K bytes
    - Viewed (0)
  8. src/math/big/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 big_test
    
    import (
    	"fmt"
    	"log"
    	"math"
    	"math/big"
    )
    
    func ExampleRat_SetString() {
    	r := new(big.Rat)
    	r.SetString("355/113")
    	fmt.Println(r.FloatString(3))
    	// Output: 3.142
    }
    
    func ExampleInt_SetString() {
    	i := new(big.Int)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 26 16:15:32 UTC 2020
    - 4K bytes
    - Viewed (0)
  9. src/math/rand/v2/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/v2"
    	"os"
    	"strings"
    	"text/tabwriter"
    	"time"
    )
    
    // 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() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 30 17:09:26 UTC 2023
    - 4.4K bytes
    - Viewed (0)
  10. src/go/ast/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 ast_test
    
    import (
    	"fmt"
    	"go/ast"
    	"go/format"
    	"go/parser"
    	"go/token"
    	"strings"
    )
    
    // This example demonstrates how to inspect the AST of a Go program.
    func ExampleInspect() {
    	// src is the input for which we want to inspect the AST.
    	src := `
    package p
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 21:44:50 UTC 2024
    - 6.1K bytes
    - Viewed (0)
Back to top