Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 221 for gofmt (0.04 sec)

  1. src/cmd/cgo/godefs.go

    			if def := typedef[name]; def != nil {
    				id.Name = gofmt(def)
    			}
    		}
    	}
    
    	conf.Fprint(&buf, fset, f.AST)
    
    	return buf.String()
    }
    
    var gofmtBuf strings.Builder
    
    // gofmt returns the gofmt-formatted string for an AST node.
    func gofmt(n interface{}) string {
    	gofmtBuf.Reset()
    	err := printer.Fprint(&gofmtBuf, fset, n)
    	if err != nil {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 20 15:50:06 UTC 2024
    - 3.2K bytes
    - Viewed (0)
  2. src/go/format/internal.go

    				indent = 0
    			}
    			// Remove the wrapping.
    			// Gofmt has turned the "; " into a "\n\n".
    			// There will be two non-blank lines with indent, hence 2*indent.
    			src = src[2*indent+len("package p\n\nfunc _() {"):]
    			// Remove only the "}\n" suffix: remaining whitespaces will be trimmed anyway
    			src = src[:len(src)-len("}\n")]
    			return bytes.TrimSpace(src)
    		}
    		// Gofmt has also indented the function body one level.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Feb 28 14:23:08 UTC 2020
    - 5K bytes
    - Viewed (0)
  3. src/cmd/fix/typecheck.go

    			if isTopName(n.Fun, "make") && len(n.Args) >= 1 {
    				typeof[n] = gofmt(n.Args[0])
    				return
    			}
    			// new(T) has type *T
    			if isTopName(n.Fun, "new") && len(n.Args) == 1 {
    				typeof[n] = "*" + gofmt(n.Args[0])
    				return
    			}
    			// Otherwise, use type of function to determine arguments.
    			t := typeof[n.Fun]
    			if t == "" {
    				t = cfg.External[gofmt(n.Fun)]
    			}
    			in, out := splitFunc(t)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Nov 16 22:02:42 UTC 2022
    - 20.1K bytes
    - Viewed (0)
  4. src/cmd/gofmt/testdata/stdin1.golden

    	//gofmt -stdin
    
    	if x {
    		y
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 22 00:25:13 UTC 2014
    - 32 bytes
    - Viewed (0)
  5. src/cmd/gofmt/testdata/stdin7.golden

    															//gofmt -stdin
    
    															if err != nil {
    																source := strings.NewReader(`line 1.
    line 2.
    `)
    																return source
    															}
    
    															f := func(hat, tail string) {
    
    																fmt.Println(hat+`
    		foo
    
    
    	`+tail,
    																	"more",
    																	"and more")
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Sep 30 00:04:48 UTC 2014
    - 342 bytes
    - Viewed (0)
  6. src/go/parser/testdata/typeset.go2

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    // This file contains test cases for typeset-only constraint elements.
    // TODO(gri) gofmt once/if gofmt supports this notation.
    
    package p
    
    type (
            _[_ t] t
            _[_ ~t] t
            _[_ t|t] t
            _[_ ~t|t] t
            _[_ t|~t] t
            _[_ ~t|~t] t
    
            _[_ t, _, _ t|t] t
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Nov 02 12:56:53 UTC 2023
    - 1.9K bytes
    - Viewed (0)
  7. src/cmd/gofmt/testdata/stdin4.golden

    	//gofmt -stdin
    
    	// comment
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 22 00:25:13 UTC 2014
    - 38 bytes
    - Viewed (0)
  8. src/cmd/gofmt/testdata/stdin4.input

    	//gofmt -stdin
    
    	// comment
    	
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 22 00:25:13 UTC 2014
    - 39 bytes
    - Viewed (0)
  9. src/go/doc/comment/testdata/para.txt

    -- input --
    Hello, world.
    This is a paragraph.
    
    -- gofmt --
    Hello, world.
    This is a paragraph.
    
    -- text --
    Hello, world. This is a paragraph.
    
    -- markdown --
    Hello, world. This is a paragraph.
    
    -- html --
    <p>Hello, world.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Apr 11 16:31:41 UTC 2022
    - 243 bytes
    - Viewed (0)
  10. src/cmd/gofmt/testdata/stdin3.golden

    		//gofmt -stdin
    
    		/* note: no newline at end of file */
    		for i := 0; i < 10; i++ {
    			s += i
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 22 00:25:13 UTC 2014
    - 101 bytes
    - Viewed (0)
Back to top