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 6bfc83aae262116d2449f24af030654d77543b99..8c3bac51e66d0e677c1dbf0c81baa98f9d9e4fb7 100644 --- a/src/cmd/go/internal/work/exec.go +++ b/src/cmd/go/internal/work/exec.go @@ -3231,6 +3231,10 @@ } // Run SWIG on one SWIG input file. func (b *Builder) swigOne(a *Action, file, objdir string, pcCFLAGS []string, cxx bool, intgosize string) (outGo, outC string, err error) { + if strings.HasPrefix(file, "cgo") { + return "", "", errors.New("SWIG file must not use prefix 'cgo'") + } + p := a.Package sh := b.Shell(a)