MCPcopy Create free account
hub / github.com/cloudfoundry/java-buildpack / HasMainMethod

Method HasMainMethod

src/java/containers/groovy_utils.go:45–51  ·  view source on GitHub ↗

HasMainMethod checks if a Groovy file contains a static void main() method

(filePath string)

Source from the content-addressed store, hash-verified

43
44// HasMainMethod checks if a Groovy file contains a static void main() method
45func (g *GroovyUtils) HasMainMethod(filePath string) bool {
46 content, err := os.ReadFile(filePath)
47 if err != nil {
48 return false
49 }
50 return mainMethodPattern.Match(content)
51}
52
53// IsPOGO checks if a Groovy file is a Plain Old Groovy Object (contains a class definition)
54func (g *GroovyUtils) IsPOGO(filePath string) bool {

Callers 3

FindMainGroovyScriptFunction · 0.95
noMainMethodMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected