Search Options

Results per page
Sort
Preferred Languages
Advance

Results 31 - 40 of 1,559 for comment1 (0.12 sec)

  1. src/cmd/go/testdata/script/build_import_comment.txt

    env GO111MODULE=off
    cd m
    
    # Import comment matches
    go build -n works.go
    
    # Import comment mismatch
    ! go build -n wrongplace.go
    stderr 'wrongplace expects import "my/x"'
    
    # Import comment syntax error
    ! go build -n bad.go
    stderr 'cannot parse import comment'
    
    # Import comment conflict
    ! go build -n conflict.go
    stderr 'found import comments'
    
    
    # Test in module mode.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Sep 17 13:25:29 UTC 2020
    - 1.2K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/buildtag/buildtag.go

    	check.init(pass)
    	defer check.finish()
    
    	for _, group := range f.Comments {
    		// A +build comment is ignored after or adjoining the package declaration.
    		if group.End()+1 >= f.Package {
    			check.plusBuildOK = false
    		}
    		// A //go:build comment is ignored after the package declaration
    		// (but adjoining it is OK, in contrast to +build comments).
    		if group.Pos() >= f.Package {
    			check.goBuildOK = false
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 9.3K bytes
    - Viewed (0)
  3. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/directive/directive.go

    	for _, group := range f.Comments {
    		// A //go:build or a //go:debug comment is ignored after the package declaration
    		// (but adjoining it is OK, in contrast to +build comments).
    		if group.Pos() >= f.Package {
    			check.inHeader = false
    		}
    
    		// Check each line of a //-comment.
    		for _, c := range group.List {
    			check.comment(c.Slash, c.Text)
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Jun 04 16:19:04 UTC 2024
    - 5.4K bytes
    - Viewed (0)
  4. src/cmd/compile/internal/syntax/testdata/sample.go

    // of error comments with the error test harness.
    
    package p
    
    // The following are invalid error comments; they are
    // silently ignored. The prefix must be exactly one of
    // "/* ERROR " or "// ERROR ".
    //
    /*ERROR*/
    /*ERROR foo*/
    /* ERRORfoo */
    /*  ERROR foo */
    //ERROR
    // ERROR
    // ERRORfoo
    //  ERROR foo
    
    // This is a valid error comment; it applies to the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 30 18:02:18 UTC 2022
    - 951 bytes
    - Viewed (0)
  5. src/cmd/gofmt/testdata/rewrite5.input

    // Rewriting of expressions containing nodes with associated comments to
    // expressions without those nodes must also eliminate the associated
    // comments.
    
    package p
    
    func f(x int) int {
    	_ = x + x // this comment remains in the rewrite
    	_ = x /* this comment must not be in the rewrite */ + x
    	return x /* this comment must not be in the rewrite */ + x
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 22 00:25:13 UTC 2014
    - 538 bytes
    - Viewed (0)
  6. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/buildtag/buildtag_old.go

    	pastCutoff := false
    	for _, group := range f.Comments {
    		// A +build comment is ignored after or adjoining the package declaration.
    		if group.End()+1 >= f.Package {
    			pastCutoff = true
    		}
    
    		// "+build" is ignored within or after a /*...*/ comment.
    		if !strings.HasPrefix(group.List[0].Text, "//") {
    			pastCutoff = true
    			continue
    		}
    
    		// Check each line of a //-comment.
    		for _, c := range group.List {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 03 02:38:00 UTC 2024
    - 4.3K bytes
    - Viewed (0)
  7. src/cmd/compile/internal/syntax/nodes.go

    // Comments
    
    // TODO(gri) Consider renaming to CommentPos, CommentPlacement, etc.
    // Kind = Above doesn't make much sense.
    type CommentKind uint
    
    const (
    	Above CommentKind = iota
    	Below
    	Left
    	Right
    )
    
    type Comment struct {
    	Kind CommentKind
    	Text string
    	Next *Comment
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Sep 20 14:52:38 UTC 2023
    - 9K bytes
    - Viewed (0)
  8. src/go/parser/resolver_test.go

    // Ident.Obj.Decl to positions marked in the source via special comments.
    //
    // In the test source, any comment prefixed with '=' or '@' (or both) marks the
    // previous token position as the declaration ('=') or a use ('@') of an
    // identifier. The text following '=' and '@' in the comment string is the
    // label to use for the location.  Declaration labels must be unique within the
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Aug 19 17:46:07 UTC 2022
    - 4.9K bytes
    - Viewed (0)
  9. src/cmd/fix/buildtag.go

    	name: "buildtag",
    	date: "2021-08-25",
    	f:    buildtag,
    	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
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Feb 22 05:31:47 UTC 2024
    - 1.2K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/imports.go

    				delspecs = delspecs[:len(delspecs)-1]
    				i--
    				break
    			}
    		}
    	}
    
    	// Delete comments from f.Comments.
    	for i := 0; i < len(f.Comments); i++ {
    		cg := f.Comments[i]
    		for j, del := range delcomments {
    			if cg == del {
    				copy(f.Comments[i:], f.Comments[i+1:])
    				f.Comments = f.Comments[:len(f.Comments)-1]
    				copy(delcomments[j:], delcomments[j+1:])
    				delcomments = delcomments[:len(delcomments)-1]
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue May 10 21:56:21 UTC 2022
    - 13.4K bytes
    - Viewed (0)
Back to top