Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 47 for 2014 (0.03 sec)

  1. 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)
  2. src/crypto/cipher/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 cipher_test
    
    import (
    	"bytes"
    	"crypto/aes"
    	"crypto/cipher"
    	"crypto/rand"
    	"encoding/hex"
    	"fmt"
    	"io"
    	"os"
    )
    
    func ExampleNewGCM_encrypt() {
    	// Load your secret key from a safe place and reuse it across multiple
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 30 16:23:44 UTC 2018
    - 11.8K bytes
    - Viewed (0)
  3. src/mime/multipart/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 multipart_test
    
    import (
    	"fmt"
    	"io"
    	"log"
    	"mime"
    	"mime/multipart"
    	"net/mail"
    	"strings"
    )
    
    func ExampleNewReader() {
    	msg := &mail.Message{
    		Header: map[string][]string{
    			"Content-Type": {"multipart/mixed; boundary=foo"},
    		},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 20 18:41:18 UTC 2020
    - 1.1K 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/crypto/md5/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 md5_test
    
    import (
    	"crypto/md5"
    	"fmt"
    	"io"
    	"log"
    	"os"
    )
    
    func ExampleNew() {
    	h := md5.New()
    	io.WriteString(h, "The fog is getting thicker!")
    	io.WriteString(h, "And Leon's getting laaarger!")
    	fmt.Printf("%x", h.Sum(nil))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Sep 19 17:29:19 UTC 2016
    - 825 bytes
    - Viewed (0)
  6. src/archive/zip/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 zip_test
    
    import (
    	"archive/zip"
    	"bytes"
    	"compress/flate"
    	"fmt"
    	"io"
    	"log"
    	"os"
    )
    
    func ExampleWriter() {
    	// Create a buffer to write our archive to.
    	buf := new(bytes.Buffer)
    
    	// Create a new zip archive.
    	w := zip.NewWriter(buf)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Jan 27 00:22:03 UTC 2016
    - 2K bytes
    - Viewed (0)
  7. src/net/smtp/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 smtp_test
    
    import (
    	"fmt"
    	"log"
    	"net/smtp"
    )
    
    func Example() {
    	// Connect to the remote SMTP server.
    	c, err := smtp.Dial("mail.example.com:25")
    	if err != nil {
    		log.Fatal(err)
    	}
    
    	// Set the sender and recipient first
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Sat Feb 07 22:23:10 UTC 2015
    - 1.9K bytes
    - Viewed (0)
  8. src/sort/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 sort_test
    
    import (
    	"fmt"
    	"math"
    	"sort"
    )
    
    func ExampleInts() {
    	s := []int{5, 2, 6, 3, 1, 4} // unsorted
    	sort.Ints(s)
    	fmt.Println(s)
    	// Output: [1 2 3 4 5 6]
    }
    
    func ExampleIntsAreSorted() {
    	s := []int{1, 2, 3, 4, 5, 6} // sorted ascending
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 28 17:29:29 UTC 2017
    - 2.8K bytes
    - Viewed (0)
  9. src/unicode/utf8/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 utf8_test
    
    import (
    	"fmt"
    	"unicode/utf8"
    )
    
    func ExampleDecodeLastRune() {
    	b := []byte("Hello, 世界")
    
    	for len(b) > 0 {
    		r, size := utf8.DecodeLastRune(b)
    		fmt.Printf("%c %v\n", r, size)
    
    		b = b[:len(b)-size]
    	}
    	// Output:
    	// 界 3
    	// 世 3
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 05 21:29:18 UTC 2021
    - 3.6K bytes
    - Viewed (0)
  10. 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)
Back to top