Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 3,299 for fmtB (0.04 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/cmd/compile/internal/test/testdata/gen/zeroGen.go

    		// type for test
    		fmt.Fprintf(w, "type Z%du1 struct {\n", s)
    		fmt.Fprintf(w, "  b   bool\n")
    		fmt.Fprintf(w, "  val [%d]byte\n", s)
    		fmt.Fprintf(w, "}\n")
    
    		fmt.Fprintf(w, "type Z%du2 struct {\n", s)
    		fmt.Fprintf(w, "  i   uint16\n")
    		fmt.Fprintf(w, "  val [%d]byte\n", s)
    		fmt.Fprintf(w, "}\n")
    
    		// function being tested
    		fmt.Fprintf(w, "//go:noinline\n")
    		fmt.Fprintf(w, "func zero%du1_ssa(t *Z%du1) {\n", s, s)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 20 02:13:02 UTC 2022
    - 4.1K bytes
    - Viewed (0)
  10. 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)
Back to top