Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 47 for 2014 (0.1 sec)

  1. src/reflect/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 reflect_test
    
    import (
    	"bytes"
    	"encoding/json"
    	"fmt"
    	"io"
    	"os"
    	"reflect"
    )
    
    func ExampleKind() {
    	for _, v := range []any{"hi", 42, func() {}} {
    		switch v := reflect.ValueOf(v); v.Kind() {
    		case reflect.String:
    			fmt.Println(v.String())
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 19 20:04:36 UTC 2022
    - 4.5K bytes
    - Viewed (0)
  2. src/crypto/x509/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 x509_test
    
    import (
    	"crypto/dsa"
    	"crypto/ecdsa"
    	"crypto/ed25519"
    	"crypto/rsa"
    	"crypto/x509"
    	"encoding/pem"
    	"fmt"
    )
    
    func ExampleCertificate_Verify() {
    	// Verifying with a custom list of root certificates.
    
    	const rootPEM = `
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jul 29 16:52:01 UTC 2019
    - 5.3K bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. src/os/signal/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 signal_test
    
    import (
    	"fmt"
    	"os"
    	"os/signal"
    )
    
    func ExampleNotify() {
    	// Set up channel on which to send signal notifications.
    	// We must use a buffered channel or risk missing the signal
    	// if we're not ready to receive when the signal is sent.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 01 18:38:23 UTC 2017
    - 1001 bytes
    - Viewed (0)
  6. 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)
  7. src/text/tabwriter/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 tabwriter_test
    
    import (
    	"fmt"
    	"os"
    	"text/tabwriter"
    )
    
    func ExampleWriter_Init() {
    	w := new(tabwriter.Writer)
    
    	// Format in tab-separated columns with a tab stop of 8.
    	w.Init(os.Stdout, 0, 8, 0, '\t', 0)
    	fmt.Fprintln(w, "a\tb\tc\td\t.")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Feb 23 22:09:32 UTC 2016
    - 2K bytes
    - Viewed (0)
  8. src/net/http/httptest/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 httptest_test
    
    import (
    	"fmt"
    	"io"
    	"log"
    	"net/http"
    	"net/http/httptest"
    )
    
    func ExampleResponseRecorder() {
    	handler := func(w http.ResponseWriter, r *http.Request) {
    		io.WriteString(w, "<html><body>Hello World!</body></html>")
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Oct 20 18:41:18 UTC 2020
    - 2K bytes
    - Viewed (0)
  9. src/encoding/csv/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 csv_test
    
    import (
    	"encoding/csv"
    	"fmt"
    	"io"
    	"log"
    	"os"
    	"strings"
    )
    
    func ExampleReader() {
    	in := `first_name,last_name,username
    "Rob","Pike",rob
    Ken,Thompson,ken
    "Robert","Griesemer","gri"
    `
    	r := csv.NewReader(strings.NewReader(in))
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 22 11:11:37 UTC 2015
    - 2.6K bytes
    - Viewed (0)
  10. src/encoding/binary/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 binary_test
    
    import (
    	"bytes"
    	"encoding/binary"
    	"fmt"
    	"math"
    )
    
    func ExampleWrite() {
    	buf := new(bytes.Buffer)
    	var pi float64 = math.Pi
    	err := binary.Write(buf, binary.LittleEndian, pi)
    	if err != nil {
    		fmt.Println("binary.Write failed:", err)
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 3.2K bytes
    - Viewed (0)
Back to top