Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 38 for gofmt (0.03 sec)

  1. src/cmd/gofmt/gofmt.go

    	// printerNormalizeNumbers means to canonicalize number literal prefixes
    	// and exponents while printing. See https://golang.org/doc/go1.13#gofmt.
    	//
    	// This value is defined in go/printer specifically for go/format and cmd/gofmt.
    	printerNormalizeNumbers = 1 << 30
    )
    
    // fdSem guards the number of concurrently-open file descriptors.
    //
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 19:41:17 UTC 2024
    - 15.1K bytes
    - Viewed (0)
  2. hack/verify-gofmt.sh

    # limitations under the License.
    
    # This script checks whether the source code needs to be formatted or not by
    # `gofmt`. Run `hack/update-gofmt.sh` to actually format sources.
    #
    # Note: gofmt output can change between go versions.
    #
    # Usage: `hack/verify-gofmt.sh`.
    
    set -o errexit
    set -o nounset
    set -o pipefail
    
    KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
    source "${KUBE_ROOT}/hack/lib/init.sh"
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 01 06:07:31 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  3. hack/update-gofmt.sh

    # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    # See the License for the specific language governing permissions and
    # limitations under the License.
    
    # GoFmt apparently is changing @ head...
    
    set -o errexit
    set -o nounset
    set -o pipefail
    
    KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
    source "${KUBE_ROOT}/hack/lib/init.sh"
    
    kube::golang::setup_env
    
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 01 06:06:56 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  4. src/regexp/syntax/make_perl_groups.pl

      }
      print "}\n";
      my $count = @entries;
    }
    
    # Prepare gofmt command
    my $gofmt;
    
    if (@ARGV > 0 && $ARGV[0] =~ /\.go$/) {
      # Send the output of gofmt to the given file
      open($gofmt, '|-', 'gofmt >'.$ARGV[0]) or die;
    } else {
      open($gofmt, '|-', 'gofmt') or die;
    }
    
    # Redirect STDOUT to gofmt input
    select $gofmt;
    
    print <<EOF;
    // Copyright 2013 The Go Authors. All rights reserved.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 13:59:01 UTC 2024
    - 2.6K bytes
    - Viewed (0)
  5. src/go/doc/comment/testdata/README.md

    The remaining files contain the expected output for the named format generated by
    [comment.Printer](https://pkg.go.dev/go/doc/comment/#Printer):
    “gofmt” for Printer.Comment (Go comment format, as used by gofmt),
    “html” for Printer.HTML, “markdown” for Printer.Markdown, and “text” for Printer.Text.
    The format can also be “dump” for a textual dump of the raw data structures.
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Mar 26 19:58:28 UTC 2024
    - 1.3K bytes
    - Viewed (0)
  6. 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)
  7. hack/lib/protoc.sh

    }
    
    # Formats $1/api.pb.go, adds the boilerplate comments and run gofmt on it
    # $1: Full path to the directory where the api.proto file is
    function kube::protoc::format() {
      local package=${1}
    
      # Update boilerplate for the generated file.
      cat hack/boilerplate/boilerplate.generatego.txt "${package}/api.pb.go" > tmpfile && mv tmpfile "${package}/api.pb.go"
    
      # Run gofmt to clean up the generated code.
      kube::golang::setup_env
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Fri Mar 01 20:53:13 UTC 2024
    - 5.1K bytes
    - Viewed (0)
  8. src/cmd/fix/main.go

    	}
    	fmt.Fprintf(os.Stderr, "%s: fixed %s\n", filename, fixlog.String()[1:])
    
    	// Print AST.  We did that after each fix, so this appears
    	// redundant, but it is necessary to generate gofmt-compatible
    	// source code in a few cases. The official gofmt style is the
    	// output of the printer run on a standard AST generated by the parser,
    	// but the source we generated inside the loop above is the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 14 19:41:17 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  9. src/cmd/fix/main_test.go

    		return
    	}
    
    	outb, err := gofmtFile(file)
    	if err != nil {
    		t.Errorf("printing: %v", err)
    		return
    	}
    	if s := string(outb); in != s && mustBeGofmt {
    		t.Errorf("not gofmt-formatted.\n--- %s\n%s\n--- %s | gofmt\n%s",
    			desc, in, desc, s)
    		tdiff(t, "want", in, "have", s)
    		return
    	}
    
    	if fn == nil {
    		for _, fix := range fixes {
    			if fix.f(file) {
    				fixed = true
    			}
    		}
    	} else {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 05:31:47 UTC 2024
    - 3.8K bytes
    - Viewed (0)
  10. src/cmd/fix/buildtag.go

    	desc: `Remove +build comments from modules using Go 1.18 or later`,
    }
    
    func buildtag(f *ast.File) bool {
    	if version.Compare(*goVersion, buildtagGoVersionCutoff) < 0 {
    		return false
    	}
    
    	// File is already gofmt-ed, so we know that if there are +build lines,
    	// they are in a comment group that starts with a //go:build line followed
    	// by a blank line. While we cannot delete comments from an AST and
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 05:31:47 UTC 2024
    - 1.2K bytes
    - Viewed (0)
Back to top