Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 3,299 for fmtX (0.03 sec)

  1. src/cmd/go/internal/fmtcmd/fmt.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 fmtcmd implements the “go fmt” command.
    package fmtcmd
    
    import (
    	"context"
    	"errors"
    	"fmt"
    	"os"
    	"path/filepath"
    
    	"cmd/go/internal/base"
    	"cmd/go/internal/cfg"
    	"cmd/go/internal/load"
    	"cmd/go/internal/modload"
    	"cmd/internal/sys"
    )
    
    func init() {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 03 12:16:35 UTC 2022
    - 3K bytes
    - Viewed (0)
  2. src/math/bits/example_test.go

    	fmt.Printf("%08b\n", bits.RotateLeft8(15, -2))
    	// Output:
    	// 00001111
    	// 00111100
    	// 11000011
    }
    
    func ExampleRotateLeft16() {
    	fmt.Printf("%016b\n", 15)
    	fmt.Printf("%016b\n", bits.RotateLeft16(15, 2))
    	fmt.Printf("%016b\n", bits.RotateLeft16(15, -2))
    	// Output:
    	// 0000000000001111
    	// 0000000000111100
    	// 1100000000000011
    }
    
    func ExampleRotateLeft32() {
    	fmt.Printf("%032b\n", 15)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 18:16:09 UTC 2019
    - 5.3K bytes
    - Viewed (0)
  3. src/cmd/compile/internal/test/testdata/gen/copyGen.go

    		fmt.Fprintf(w, "    t.Errorf(\"t%dcopy got=%%v, want %%v\\n\", a, want)\n", s)
    		fmt.Fprintf(w, "  }\n")
    		fmt.Fprintf(w, "}\n")
    	}
    
    	for _, s := range usizes {
    		// function being tested
    		fmt.Fprintf(w, "//go:noinline\n")
    		fmt.Fprintf(w, "func tu%dcopy_ssa(docopy bool, data [%d]byte, x *[%d]byte) {\n", s, s, s)
    		fmt.Fprintf(w, "  if docopy {\n")
    		fmt.Fprintf(w, "    *x = data\n")
    		fmt.Fprintf(w, "  }\n")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 20 02:13:02 UTC 2022
    - 3.6K bytes
    - Viewed (0)
  4. src/net/example_test.go

    	ipv4Public := net.ParseIP("8.8.8.8")
    	ipv4Broadcast := net.ParseIP("255.255.255.255")
    
    	fmt.Println(ipv6Global.IsGlobalUnicast())
    	fmt.Println(ipv6UniqLocal.IsGlobalUnicast())
    	fmt.Println(ipv6Multi.IsGlobalUnicast())
    
    	fmt.Println(ipv4Private.IsGlobalUnicast())
    	fmt.Println(ipv4Public.IsGlobalUnicast())
    	fmt.Println(ipv4Broadcast.IsGlobalUnicast())
    
    	// Output:
    	// true
    	// true
    	// false
    	// true
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Oct 13 16:36:59 UTC 2021
    - 8.5K bytes
    - Viewed (0)
  5. src/strconv/example_test.go

    	b16 = strconv.AppendUint(b16, 42, 16)
    	fmt.Println(string(b16))
    
    	// Output:
    	// uint (base 10):42
    	// uint (base 16):2a
    }
    
    func ExampleAtoi() {
    	v := "10"
    	if s, err := strconv.Atoi(v); err == nil {
    		fmt.Printf("%T, %v", s, s)
    	}
    
    	// Output:
    	// int, 10
    }
    
    func ExampleCanBackquote() {
    	fmt.Println(strconv.CanBackquote("Fran & Freddie's Diner ☺"))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Oct 13 22:57:37 UTC 2023
    - 8.9K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/test/testdata/gen/constFoldGen.go

    					fmt.Fprintf(w, "\ty = %d\n", d)
    					fmt.Fprintf(w, "\tr = x %s y\n", o.symbol)
    					want := ansS(c, d, s.name, o.symbol)
    					fmt.Fprintf(w, "\tif r != %s {\n", want)
    					fmt.Fprintf(w, "\t\tt.Errorf(\"%d %%s %d = %%d, want %s\", %q, r)\n", c, d, want, o.symbol)
    					fmt.Fprintf(w, "\t}\n")
    				}
    			}
    			fmt.Fprintf(w, "}\n")
    		}
    	}
    
    	// Special signed/unsigned cases for shifts
    	for _, ls := range szs {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 20 02:13:02 UTC 2022
    - 8.4K bytes
    - Viewed (0)
  7. src/slices/example_test.go

    	grow := slices.Grow(numbers, 2)
    	fmt.Println(cap(numbers))
    	fmt.Println(grow)
    	fmt.Println(len(grow))
    	fmt.Println(cap(grow))
    	// Output:
    	// 4
    	// [0 42 -10 8]
    	// 4
    	// 8
    }
    
    func ExampleClip() {
    	a := [...]int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
    	s := a[:4:10]
    	clip := slices.Clip(s)
    	fmt.Println(cap(s))
    	fmt.Println(clip)
    	fmt.Println(len(clip))
    	fmt.Println(cap(clip))
    	// Output:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 17:28:50 UTC 2024
    - 8.1K bytes
    - Viewed (0)
  8. src/math/example_test.go

    	fmt.Printf("%.2f\n", math.Dim(4, -2))
    	fmt.Printf("%.2f\n", math.Dim(-4, 2))
    	// Output:
    	// 6.00
    	// 0.00
    }
    
    func ExampleExp() {
    	fmt.Printf("%.2f\n", math.Exp(1))
    	fmt.Printf("%.2f\n", math.Exp(2))
    	fmt.Printf("%.2f\n", math.Exp(-1))
    	// Output:
    	// 2.72
    	// 7.39
    	// 0.37
    }
    
    func ExampleExp2() {
    	fmt.Printf("%.2f\n", math.Exp2(1))
    	fmt.Printf("%.2f\n", math.Exp2(-3))
    	// Output:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 07 18:09:53 UTC 2021
    - 3.7K bytes
    - Viewed (0)
  9. src/unicode/utf8/example_test.go

    	fmt.Println("runes =", utf8.RuneCountInString(str))
    	// Output:
    	// bytes = 13
    	// runes = 9
    }
    
    func ExampleRuneLen() {
    	fmt.Println(utf8.RuneLen('a'))
    	fmt.Println(utf8.RuneLen('界'))
    	// Output:
    	// 1
    	// 3
    }
    
    func ExampleRuneStart() {
    	buf := []byte("a界")
    	fmt.Println(utf8.RuneStart(buf[0]))
    	fmt.Println(utf8.RuneStart(buf[1]))
    	fmt.Println(utf8.RuneStart(buf[2]))
    	// Output:
    	// true
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Nov 05 21:29:18 UTC 2021
    - 3.6K bytes
    - Viewed (0)
  10. src/cmd/internal/obj/loong64/asm_test.go

    	genSize2 := (1 << 21) + 16
    
    	fmt.Fprintln(buf, "TEXT f(SB),0,$0-0")
    	fmt.Fprintln(buf, "BEQ R5, R6, label18")
    	fmt.Fprintln(buf, "BNE R5, R6, label18")
    	fmt.Fprintln(buf, "BGE R5, R6, label18")
    
    	fmt.Fprintln(buf, "BGEU R5, R6, label18")
    	fmt.Fprintln(buf, "BLTU R5, R6, label18")
    
    	fmt.Fprintln(buf, "BLEZ R5, label18")
    	fmt.Fprintln(buf, "BGEZ R5, label18")
    	fmt.Fprintln(buf, "BLTZ R5, label18")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 15 17:39:37 UTC 2024
    - 2.2K bytes
    - Viewed (0)
Back to top