1
0
mirror of https://github.com/mgechev/revive.git synced 2025-11-25 22:12:38 +02:00

docs: improve comments for functions; enable godot (#1382)

This commit is contained in:
Oleksandr Redko
2025-05-27 08:44:24 +03:00
committed by GitHub
parent 398f7a83eb
commit f4976873e7
49 changed files with 135 additions and 132 deletions

View File

@@ -29,7 +29,7 @@ func (f *File) Content() []byte {
return f.content
}
// NewFile creates a new file
// NewFile creates a new file.
func NewFile(name string, content []byte, pkg *Package) (*File, error) {
f, err := parser.ParseFile(pkg.fset, name, content, parser.ParseComments)
if err != nil {
@@ -73,7 +73,7 @@ var basicTypeKinds = map[types.BasicKind]string{
// IsUntypedConst reports whether expr is an untyped constant,
// and indicates what its default type is.
// scope may be nil.
// Scope may be nil.
func (f *File) IsUntypedConst(expr ast.Expr) (defType string, ok bool) {
// Re-evaluate expr outside its context to see if it's untyped.
// (An expr evaluated within, for example, an assignment context will get the type of the LHS.)