Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 5,348 for fmt (0.09 sec)

  1. src/cmd/compile/internal/types/fmt.go

    //	%S	Short syntax: Name only, no matter what.
    func (s *Sym) Format(f fmt.State, verb rune) {
    	mode := fmtGo
    	switch verb {
    	case 'v', 'S':
    		if verb == 'v' && f.Flag('+') {
    			mode = fmtDebug
    		}
    		fmt.Fprint(f, sconv(s, verb, mode))
    
    	default:
    		fmt.Fprintf(f, "%%!%c(*types.Sym=%p)", verb, s)
    	}
    }
    
    func (s *Sym) String() string {
    	return sconv(s, 0, fmtGo)
    }
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 15:41:17 UTC 2023
    - 15.7K bytes
    - Viewed (0)
  2. src/cmd/compile/internal/ir/fmt.go

    		fmt.Fprint(s, "[")
    		if n.Low != nil {
    			fmt.Fprint(s, n.Low)
    		}
    		fmt.Fprint(s, ":")
    		if n.High != nil {
    			fmt.Fprint(s, n.High)
    		}
    		if n.Op().IsSlice3() {
    			fmt.Fprint(s, ":")
    			if n.Max != nil {
    				fmt.Fprint(s, n.Max)
    			}
    		}
    		fmt.Fprint(s, "]")
    
    	case OSLICEHEADER:
    		n := n.(*SliceHeaderExpr)
    		fmt.Fprintf(s, "sliceheader{%v,%v,%v}", n.Ptr, n.Len, n.Cap)
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 05 15:20:28 UTC 2023
    - 26K bytes
    - Viewed (0)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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)
  8. 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)
  9. test/map.go

    	// test len
    	if len(mib) != count {
    		panic(fmt.Sprintf("len(mib) = %d\n", len(mib)))
    	}
    	if len(mii) != count {
    		panic(fmt.Sprintf("len(mii) = %d\n", len(mii)))
    	}
    	if len(mfi) != count {
    		panic(fmt.Sprintf("len(mfi) = %d\n", len(mfi)))
    	}
    	if len(mif) != count {
    		panic(fmt.Sprintf("len(mif) = %d\n", len(mif)))
    	}
    	if len(msi) != count {
    		panic(fmt.Sprintf("len(msi) = %d\n", len(msi)))
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Aug 06 21:02:55 UTC 2014
    - 14.9K bytes
    - Viewed (0)
  10. 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)
Back to top