Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 43 for 2014 (0.04 sec)

  1. 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)
  2. 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. src/encoding/xml/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 xml_test
    
    import (
    	"encoding/xml"
    	"fmt"
    	"os"
    )
    
    func ExampleMarshalIndent() {
    	type Address struct {
    		City, State string
    	}
    	type Person struct {
    		XMLName   xml.Name `xml:"person"`
    		Id        int      `xml:"id,attr"`
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 01 23:34:33 UTC 2016
    - 3.7K bytes
    - Viewed (0)
  9. src/html/template/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 template_test
    
    import (
    	"fmt"
    	"html/template"
    	"log"
    	"os"
    	"strings"
    )
    
    func Example() {
    	const tpl = `
    <!DOCTYPE html>
    <html>
    	<head>
    		<meta charset="UTF-8">
    		<title>{{.Title}}</title>
    	</head>
    	<body>
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 3.9K bytes
    - Viewed (0)
  10. src/unicode/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 unicode_test
    
    import (
    	"fmt"
    	"unicode"
    )
    
    // Functions starting with "Is" can be used to inspect which table of range a
    // rune belongs to. Note that runes may fit into more than one range.
    func Example_is() {
    
    	// constant with mixed type runes
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 08 00:18:29 UTC 2021
    - 5.2K bytes
    - Viewed (0)
Back to top