Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for ExampleHello (0.31 sec)

  1. src/go/doc/testdata/examples/multiple.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package foo_test
    
    import (
    	"flag"
    	"fmt"
    	"log"
    	"os/exec"
    	"sort"
    )
    
    func ExampleHello() {
    	fmt.Println("Hello, world!")
    	// Output: Hello, world!
    }
    
    func ExampleImport() {
    	out, err := exec.Command("date").Output()
    	if err != nil {
    		log.Fatal(err)
    	}
    	fmt.Printf("The date is %s\n", out)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 10 16:17:51 UTC 2022
    - 1.7K bytes
    - Viewed (0)
  2. src/testing/testing.go

    // the standard output of the function when the tests are run. (The comparison
    // ignores leading and trailing space.) These are examples of an example:
    //
    //	func ExampleHello() {
    //	    fmt.Println("hello")
    //	    // Output: hello
    //	}
    //
    //	func ExampleSalutations() {
    //	    fmt.Println("hello, and")
    //	    fmt.Println("goodbye")
    //	    // Output:
    //	    // hello, and
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 76.1K bytes
    - Viewed (0)
Back to top