Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for SetF (0.04 sec)

  1. src/go/types/example_test.go

    func ExampleMethodSet() {
    	// Parse a single source file.
    	const input = `
    package temperature
    import "fmt"
    type Celsius float64
    func (c Celsius) String() string  { return fmt.Sprintf("%g°C", c) }
    func (c *Celsius) SetF(f float64) { *c = Celsius(f - 32 / 9 * 5) }
    
    type S struct { I; m int }
    type I interface { m() byte }
    `
    	fset := token.NewFileSet()
    	f, err := parser.ParseFile(fset, "celsius.go", input, 0)
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 8.9K bytes
    - Viewed (0)
Back to top