diff --git a/cmd/yaegi/extract.go b/cmd/yaegi/extract.go index 5366551d5..8ca4f834a 100644 --- a/cmd/yaegi/extract.go +++ b/cmd/yaegi/extract.go @@ -69,7 +69,7 @@ func extractCmd(arg []string) error { ext.Include = strings.Split(include, ",") } - r := strings.NewReplacer("/", "-", ".", "_") + r := strings.NewReplacer("/", "-", ".", "_", "~", "_") for _, pkgIdent := range args { var buf bytes.Buffer diff --git a/extract/extract.go b/extract/extract.go index 50fb06337..1bb324d4c 100644 --- a/extract/extract.go +++ b/extract/extract.go @@ -132,7 +132,7 @@ func matchList(name string, list []string) (match bool, err error) { func (e *Extractor) genContent(importPath string, p *types.Package) ([]byte, error) { prefix := "_" + importPath + "_" - prefix = strings.NewReplacer("/", "_", "-", "_", ".", "_").Replace(prefix) + prefix = strings.NewReplacer("/", "_", "-", "_", ".", "_", "~", "_").Replace(prefix) typ := map[string]string{} val := map[string]Val{}