Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 2,159 for fprint (0.24 sec)

  1. src/cmd/compile/internal/test/testdata/gen/arithBoundaryGen.go

    func main() {
    	w := new(bytes.Buffer)
    	fmt.Fprintf(w, "// Code generated by gen/arithBoundaryGen.go. DO NOT EDIT.\n\n")
    	fmt.Fprintf(w, "package main;\n")
    	fmt.Fprintf(w, "import \"testing\"\n")
    
    	for _, sz := range []int{64, 32, 16, 8} {
    		fmt.Fprintf(w, "type utd%d struct {\n", sz)
    		fmt.Fprintf(w, "  a,b uint%d\n", sz)
    		fmt.Fprintf(w, "  add,sub,mul,div,mod uint%d\n", sz)
    		fmt.Fprintf(w, "}\n")
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 20 02:13:02 UTC 2022
    - 5.5K bytes
    - Viewed (0)
  2. src/go/ast/print_test.go

    			i++
    		}
    	}
    	return strings.Join(lines[0:i], "\n")
    }
    
    func TestPrint(t *testing.T) {
    	var buf strings.Builder
    	for _, test := range tests {
    		buf.Reset()
    		if err := Fprint(&buf, nil, test.x, nil); err != nil {
    			t.Errorf("Fprint failed: %s", err)
    		}
    		if s, ts := trim(buf.String()), trim(test.s); s != ts {
    			t.Errorf("got:\n%s\nexpected:\n%s\n", s, ts)
    		}
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 09 15:35:30 UTC 2022
    - 1.8K bytes
    - Viewed (0)
  3. src/go/printer/example_test.go

    	// file set fset.
    	funcAST, fset := parseFunc("example_test.go", "printSelf")
    
    	// Print the function body into buffer buf.
    	// The file set is provided to the printer so that it knows
    	// about the original source formatting and can add additional
    	// line breaks where they were present in the source.
    	var buf bytes.Buffer
    	printer.Fprint(&buf, fset, funcAST.Body)
    
    	// Remove braces {} enclosing the function body, unindent,
    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/runtime/mksizeclasses.go

    	fmt.Fprintf(w, "_MaxSmallSize = %d\n", maxSmallSize)
    	fmt.Fprintf(w, "smallSizeDiv = %d\n", smallSizeDiv)
    	fmt.Fprintf(w, "smallSizeMax = %d\n", smallSizeMax)
    	fmt.Fprintf(w, "largeSizeDiv = %d\n", largeSizeDiv)
    	fmt.Fprintf(w, "_NumSizeClasses = %d\n", len(classes))
    	fmt.Fprintf(w, "_PageShift = %d\n", pageShift)
    	fmt.Fprintf(w, "maxObjsPerSpan = %d\n", maxObjsPerSpan(classes))
    	fmt.Fprintln(w, ")")
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 22 20:31:27 UTC 2024
    - 9.6K bytes
    - Viewed (0)
  5. src/go/printer/performance_test.go

    	declSize int64
    )
    
    func testprint(out io.Writer, node ast.Node) {
    	if err := (&Config{TabIndent | UseSpaces | normalizeNumbers, 8, 0}).Fprint(out, fset, node); err != nil {
    		log.Fatalf("print error: %s", err)
    	}
    }
    
    // cannot initialize in init because (printer) Fprint launches goroutines.
    func initialize() {
    	const filename = "testdata/parser.go"
    
    	src, err := os.ReadFile(filename)
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Sep 09 15:10:10 UTC 2022
    - 1.8K bytes
    - Viewed (0)
  6. src/math/bits/make_tables.go

    	// Use a const string to allow the compiler to constant-evaluate lookups at constant index.
    	fmt.Fprintf(w, "const %s = \"\"+\n\"", name)
    	for i := 0; i < 256; i++ {
    		fmt.Fprintf(w, "\\x%02x", f(uint8(i)))
    		if i%16 == 15 && i != 255 {
    			fmt.Fprint(w, "\"+\n\"")
    		}
    	}
    	fmt.Fprint(w, "\"\n\n")
    }
    
    func ntz8(x uint8) (n uint8) {
    	for x&1 == 0 && n < 8 {
    		x >>= 1
    		n++
    	}
    	return
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:27 UTC 2023
    - 1.5K bytes
    - Viewed (0)
  7. istioctl/pkg/writer/table/writer.go

    		return
    	}
    	sep := getMaxWidths(output)
    	for _, row := range output {
    		for i, col := range row {
    			_, _ = fmt.Fprint(c.writer, col.String())
    			if i == len(row)-1 {
    				_, _ = fmt.Fprint(c.writer, "\n")
    			} else {
    				padAmount := sep[i] - utf8.RuneCount([]byte(col.Value)) + 2
    				_, _ = fmt.Fprint(c.writer, strings.Repeat(" ", padAmount))
    			}
    		}
    	}
    }
    
    func max(x, y int) int {
    	if x < y {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Sat Oct 08 04:41:42 UTC 2022
    - 2.8K bytes
    - Viewed (0)
  8. src/cmd/compile/internal/ssa/html.go

    	}
    	var buf strings.Builder
    	fmt.Fprint(&buf, "<div class=\"lines\" style=\"width: 8%\">")
    	filename := ""
    	for _, fl := range all {
    		fmt.Fprint(&buf, "<div>&nbsp;</div>")
    		if filename != fl.Filename {
    			fmt.Fprint(&buf, "<div>&nbsp;</div>")
    			filename = fl.Filename
    		}
    		for i := range fl.Lines {
    			ln := int(fl.StartLineno) + i
    			fmt.Fprintf(&buf, "<div class=\"l%v line-number\">%v</div>", ln, ln)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 04 15:11:40 UTC 2023
    - 34.8K bytes
    - Viewed (0)
  9. src/os/executable_test.go

    	before, err := os.Executable()
    	if err != nil {
    		fmt.Fprintf(os.Stderr, "failed to read executable name before deletion: %v\n", err)
    		os.Exit(1)
    	}
    
    	err = os.Remove(before)
    	if err != nil {
    		fmt.Fprintf(os.Stderr, "failed to remove executable: %v\n", err)
    		os.Exit(1)
    	}
    
    	after, err := os.Executable()
    	if err != nil {
    		fmt.Fprintf(os.Stderr, "failed to read executable name after deletion: %v\n", err)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 05 23:35:32 UTC 2023
    - 3.4K bytes
    - Viewed (0)
  10. src/fmt/example_test.go

    // prints, while Print adds blanks only between non-string arguments and Printf
    // does exactly what it is told.
    // Sprint, Sprintln, Sprintf, Fprint, Fprintln, and Fprintf behave the same as
    // their corresponding Print, Println, and Printf functions shown here.
    func Example_printers() {
    	a, b := 3.0, 4.0
    	h := math.Hypot(a, b)
    
    	// Print inserts blanks between arguments when neither is a string.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Mar 25 21:03:10 UTC 2019
    - 11.8K bytes
    - Viewed (0)
Back to top