src/cmd/go/internal/work/exec.go | 4 ++++ diff --git a/src/cmd/go/internal/work/exec.go b/src/cmd/go/internal/work/exec.go index 8e302766711ea4c85c5b10b3dc80c245e706bc8f..01591c9c9bbceb78be6bf23b52483507682c89f0 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -3455,6 +3455,10 @@ } // Run SWIG on one SWIG input file. func (b *Builder) swigOne(a *Action, file, objdir string, pcCFLAGS []string, cxx bool, intgosize string) error { + if strings.HasPrefix(file, "cgo") { + return errors.New("SWIG file must not use prefix 'cgo'") + } + p := a.Package sh := b.Shell(a)