Search Options

Results per page
Sort
Preferred Languages
Advance

Results 51 - 60 of 2,159 for fprint (0.13 sec)

  1. src/cmd/compile/internal/syntax/printer_test.go

    	"testing"
    )
    
    func TestPrint(t *testing.T) {
    	if testing.Short() {
    		t.Skip("skipping test in short mode")
    	}
    
    	ast, _ := ParseFile(*src_, func(err error) { t.Error(err) }, nil, 0)
    
    	if ast != nil {
    		Fprint(testOut(), ast, LineForm)
    		fmt.Println()
    	}
    }
    
    type shortBuffer struct {
    	buf []byte
    }
    
    func (w *shortBuffer) Write(data []byte) (n int, err error) {
    	w.buf = append(w.buf, data...)
    	n = len(data)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jul 31 17:08:18 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  2. src/cmd/gofmt/long_test.go

    	f, _, _, err := parse(fset, filename, src.Bytes(), false)
    	if err != nil {
    		return err
    	}
    	ast.SortImports(fset, f)
    	src.Reset()
    	return (&printer.Config{Mode: printerMode, Tabwidth: tabWidth}).Fprint(src, fset, f)
    }
    
    func testFile(t *testing.T, b1, b2 *bytes.Buffer, filename string) {
    	// open file
    	f, err := os.Open(filename)
    	if err != nil {
    		t.Error(err)
    		return
    	}
    
    	// read file
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 20:27:28 UTC 2023
    - 3.8K bytes
    - Viewed (0)
  3. src/log/slog/internal/benchmarks/handlers.go

    	case slog.KindTime:
    		h.appendTime(buf, v.Time())
    	case slog.KindAny:
    		a := v.Any()
    		switch a := a.(type) {
    		case error:
    			buf.WriteString(a.Error())
    		default:
    			fmt.Fprint(buf, a)
    		}
    	default:
    		panic(fmt.Sprintf("bad kind: %s", v.Kind()))
    	}
    }
    
    func (h *fastTextHandler) appendTime(buf *buffer.Buffer, t time.Time) {
    	*buf = strconv.AppendInt(*buf, t.Unix(), 10)
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 12 20:33:37 UTC 2023
    - 4.1K bytes
    - Viewed (0)
  4. src/cmd/dist/buildgo.go

    	} else {
    		clang, gcc := "clang", "gcc"
    		if strings.HasSuffix(name, "CXX") {
    			clang, gcc = "clang++", "g++"
    		}
    		fmt.Fprintf(&buf, "\tswitch goos {\n")
    		fmt.Fprintf(&buf, "\tcase ")
    		for i, os := range clangos {
    			if i > 0 {
    				fmt.Fprintf(&buf, ", ")
    			}
    			fmt.Fprintf(&buf, "%s", quote(os))
    		}
    		fmt.Fprintf(&buf, ":\n")
    		fmt.Fprintf(&buf, "\t\treturn %s\n", quote(clang))
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 13 20:44:00 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  5. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/copylock/copylock.go

    	}
    }
    
    type typePath []string
    
    // String pretty-prints a typePath.
    func (path typePath) String() string {
    	n := len(path)
    	var buf bytes.Buffer
    	for i := range path {
    		if i > 0 {
    			fmt.Fprint(&buf, " contains ")
    		}
    		// The human-readable path is in reverse order, outermost to innermost.
    		fmt.Fprint(&buf, path[n-i-1])
    	}
    	return buf.String()
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 9.9K bytes
    - Viewed (0)
  6. src/cmd/compile/internal/types/fmt.go

    func tconv2(b *bytes.Buffer, t *Type, verb rune, mode fmtMode, visited map[*Type]int) {
    	if off, ok := visited[t]; ok {
    		// We've seen this type before, so we're trying to print it recursively.
    		// Print a reference to it instead.
    		fmt.Fprintf(b, "@%d", off)
    		return
    	}
    	if t == nil {
    		b.WriteString("<T>")
    		return
    	}
    	if t.Kind() == TSSA {
    		b.WriteString(t.extra.(string))
    		return
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 12 15:41:17 UTC 2023
    - 15.7K bytes
    - Viewed (0)
  7. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/internal/analysisutil/util.go

    	"golang.org/x/tools/internal/analysisinternal"
    )
    
    // Format returns a string representation of the expression.
    func Format(fset *token.FileSet, x ast.Expr) string {
    	var b bytes.Buffer
    	printer.Fprint(&b, fset, x)
    	return b.String()
    }
    
    // HasSideEffects reports whether evaluation of e has side effects.
    func HasSideEffects(info *types.Info, e ast.Expr) bool {
    	safe := true
    	ast.Inspect(e, func(node ast.Node) bool {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 3.9K bytes
    - Viewed (0)
  8. src/io/example_test.go

    	if _, err := io.Copy(w, r); err != nil {
    		log.Fatal(err)
    	}
    
    	fmt.Print(buf1.String())
    	fmt.Print(buf2.String())
    
    	// Output:
    	// some io.Reader stream to be read
    	// some io.Reader stream to be read
    }
    
    func ExamplePipe() {
    	r, w := io.Pipe()
    
    	go func() {
    		fmt.Fprint(w, "some io.Reader stream to be read\n")
    		w.Close()
    	}()
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 06 15:49:32 UTC 2022
    - 5.5K bytes
    - Viewed (0)
  9. istioctl/pkg/multicluster/remote_secret.go

    				return err
    			}
    			out, warn, err := CreateRemoteSecret(client, opts)
    			if err != nil {
    				_, _ = fmt.Fprintf(c.OutOrStderr(), "error: %v\n", err)
    				return err
    			}
    			if warn != nil {
    				_, _ = fmt.Fprintf(c.OutOrStderr(), "warn: %v\n", warn)
    			}
    			_, _ = fmt.Fprint(c.OutOrStdout(), out)
    			return nil
    		},
    	}
    	opts.addFlags(c.PersistentFlags())
    	return c
    }
    
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Wed Oct 11 01:43:17 UTC 2023
    - 24K bytes
    - Viewed (0)
  10. istioctl/pkg/validate/validate.go

    				if fname == "-" {
    					_, _ = fmt.Fprint(writer, warningToString(w))
    					break
    				}
    				_, _ = fmt.Fprintf(writer, "%q has warnings: %v\n", fname, warningToString(w))
    			}
    		}
    		return errs
    	}
    	for _, fname := range filenames {
    		if fname == "-" {
    			if w := warningsByFilename[fname]; w != nil {
    				_, _ = fmt.Fprint(writer, warningToString(w))
    			} else {
    Registered: Fri Jun 14 15:00:06 UTC 2024
    - Last Modified: Mon Jan 22 17:58:52 UTC 2024
    - 15K bytes
    - Viewed (0)
Back to top