From 757ea567c64a760ba32e990f10b96cd62c16f78b Mon Sep 17 00:00:00 2001 From: visualfc Date: Tue, 27 Feb 2024 11:37:49 +0800 Subject: [PATCH] x/typescheck: add Config.IgnoreFuncBodies --- x/typesutil/check.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/x/typesutil/check.go b/x/typesutil/check.go index 28cc2c299..080193447 100644 --- a/x/typesutil/check.go +++ b/x/typesutil/check.go @@ -77,6 +77,9 @@ type Config struct { // Default is github.com/goplus/. C2goBase string + // If IgnoreFuncBodies is set, skip compiling function bodies (optional). + IgnoreFuncBodies bool + // Mod represents a Go+ module (optional). Mod *gopmod.Module } @@ -152,6 +155,7 @@ func (p *Checker) Files(goFiles []*goast.File, gopFiles []*ast.File) (err error) NoFileLine: true, NoAutoGenMain: true, NoSkipConstant: true, + Outline: opts.IgnoreFuncBodies, }) if err != nil { if onErr := conf.Error; onErr != nil {