MCPcopy Create free account
hub / github.com/apache/fory / isCompileGuardError

Function isCompileGuardError

go/fory/codegen/generator.go:363–378  ·  view source on GitHub ↗

isCompileGuardError checks if the error is due to compile-time guard conflicts

(errMsg string)

Source from the content-addressed store, hash-verified

361
362// isCompileGuardError checks if the error is due to compile-time guard conflicts
363func isCompileGuardError(errMsg string) bool {
364 // Look for patterns indicating compile-time guard failures
365 patterns := []string{
366 "cannot convert x (variable of type",
367 "to type _", "_expected",
368 "_expected struct",
369 }
370
371 errMsgLower := strings.ToLower(errMsg)
372 for _, pattern := range patterns {
373 if strings.Contains(errMsgLower, strings.ToLower(pattern)) {
374 return true
375 }
376 }
377 return false
378}
379
380// cleanupGeneratedFiles removes generated files to allow regeneration
381func cleanupGeneratedFiles(opts *GeneratorOptions) error {

Callers 3

RunFunction · 0.70
runFileModeFunction · 0.70
runPackageModeFunction · 0.70

Calls 1

ContainsMethod · 0.45

Tested by

no test coverage detected