Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 1,030 for Lparen (0.24 sec)

  1. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/unusedresult/unusedresult.go

    				if stringMethods[fn.Name()] {
    					pass.Reportf(call.Lparen, "result of (%s).%s call not used",
    						sig.Recv().Type(), fn.Name())
    				}
    			}
    		} else {
    			// package-level function (e.g. fmt.Errorf)
    			if pkgFuncs[[2]string{fn.Pkg().Path(), fn.Name()}] {
    				pass.Reportf(call.Lparen, "result of %s.%s call not used",
    					fn.Pkg().Path(), fn.Name())
    			}
    		}
    	})
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jan 22 19:00:13 UTC 2024
    - 4.5K bytes
    - Viewed (0)
  2. src/cmd/vendor/golang.org/x/tools/go/ast/astutil/imports.go

    	}
    	newImport.Path.ValuePos = pos
    	newImport.EndPos = pos
    
    	// Clean up parens. impDecl contains at least one spec.
    	if len(impDecl.Specs) == 1 {
    		// Remove unneeded parens.
    		impDecl.Lparen = token.NoPos
    	} else if !impDecl.Lparen.IsValid() {
    		// impDecl needs parens added.
    		impDecl.Lparen = impDecl.Specs[0].Pos()
    	}
    
    	f.Imports = append(f.Imports, newImport)
    
    	if len(f.Decls) <= 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)
  3. src/cmd/fix/fix.go

    		copy(f.Decls[lastImport+2:], f.Decls[lastImport+1:])
    		f.Decls[lastImport+1] = impDecl
    	}
    
    	// Ensure the import decl has parentheses, if needed.
    	if len(impDecl.Specs) > 0 && !impDecl.Lparen.IsValid() {
    		impDecl.Lparen = impDecl.Pos()
    	}
    
    	insertAt := impIndex + 1
    	if insertAt == 0 {
    		insertAt = len(impDecl.Specs)
    	}
    	impDecl.Specs = append(impDecl.Specs, nil)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Dec 13 18:45:54 UTC 2021
    - 14.6K bytes
    - Viewed (0)
  4. src/go/format/format.go

    	for _, d := range file.Decls {
    		d, ok := d.(*ast.GenDecl)
    		if !ok || d.Tok != token.IMPORT {
    			// Not an import declaration, so we're done.
    			// Imports are always first.
    			return false
    		}
    		if d.Lparen.IsValid() {
    			// For now assume all grouped imports are unsorted.
    			// TODO(gri) Should check if they are sorted already.
    			return true
    		}
    		// Ungrouped imports are sorted by default.
    	}
    	return false
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 12:02:03 UTC 2023
    - 4.3K bytes
    - Viewed (0)
  5. src/go/ast/example_test.go

    	//     29  .  .  .  .  .  .  .  Fun: *ast.Ident {
    	//     30  .  .  .  .  .  .  .  .  NamePos: 4:2
    	//     31  .  .  .  .  .  .  .  .  Name: "println"
    	//     32  .  .  .  .  .  .  .  }
    	//     33  .  .  .  .  .  .  .  Lparen: 4:9
    	//     34  .  .  .  .  .  .  .  Args: []ast.Expr (len = 1) {
    	//     35  .  .  .  .  .  .  .  .  0: *ast.BasicLit {
    	//     36  .  .  .  .  .  .  .  .  .  ValuePos: 4:10
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed May 15 21:44:50 UTC 2024
    - 6.1K bytes
    - Viewed (0)
  6. src/go/doc/example.go

    			if d.Doc != nil {
    				comments = append(comments, d.Doc)
    			}
    		}
    	}
    
    	// Synthesize import declaration.
    	importDecl := &ast.GenDecl{
    		Tok:    token.IMPORT,
    		Lparen: 1, // Need non-zero Lparen and Rparen so that printer
    		Rparen: 1, // treats this as a factored import.
    	}
    	importDecl.Specs = append(namedImports, blankImports...)
    
    	// Synthesize main function.
    	funcDecl := &ast.FuncDecl{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 21.4K bytes
    - Viewed (0)
  7. src/go/ast/import.go

    		d.Specs = specs
    
    		// Deduping can leave a blank line before the rparen; clean that up.
    		if len(d.Specs) > 0 {
    			lastSpec := d.Specs[len(d.Specs)-1]
    			lastLine := lineAt(fset, lastSpec.Pos())
    			rParenLine := lineAt(fset, d.Rparen)
    			for rParenLine > lastLine+1 {
    				rParenLine--
    				fset.File(d.Rparen).MergeLine(rParenLine)
    			}
    		}
    	}
    }
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 5.7K bytes
    - Viewed (0)
  8. src/go/printer/printer_test.go

    	// now remove parentheses from the declaration
    	for i := 0; i != len(f.Decls); i++ {
    		f.Decls[i].(*ast.GenDecl).Lparen = token.NoPos
    	}
    	buf.Reset()
    	err = Fprint(&buf, fset, f)
    	if err != nil {
    		t.Fatal(err)
    	}
    	noparen := buf.String()
    
    	if noparen != original {
    		t.Errorf("got %q, want %q", noparen, original)
    	}
    }
    
    // Verify that we don't print a newline between "return" and its results, as
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 03 14:56:25 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  9. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/cgocall/cgocall.go

    		if name == "CBytes" {
    			return true
    		}
    
    		if debug {
    			log.Printf("%s: call to C.%s", fset.Position(call.Lparen), name)
    		}
    
    		for _, arg := range call.Args {
    			if !typeOKForCgoCall(cgoBaseType(info, arg), make(map[types.Type]bool)) {
    				reportf(arg.Pos(), "possibly passing Go type with embedded pointer to C")
    				break
    			}
    
    			// Check for passing the address of a bad type.
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 19 23:33:33 UTC 2023
    - 11.2K bytes
    - Viewed (0)
  10. src/cmd/vendor/golang.org/x/tools/go/analysis/passes/printf/printf.go

    	if idx < 0 {
    		if false {
    			pass.Reportf(call.Lparen, "can't check non-constant format in call to %s", fn.FullName())
    		}
    		return
    	}
    
    	firstArg := idx + 1 // Arguments are immediately after format string.
    	if !strings.Contains(format, "%") {
    		if len(call.Args) > firstArg {
    			pass.Reportf(call.Lparen, "%s call has arguments but no formatting directives", fn.FullName())
    		}
    		return
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Tue Apr 02 02:20:05 UTC 2024
    - 32.5K bytes
    - Viewed (0)
Back to top