Commit 799f09aa authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 469c1316
...@@ -491,11 +491,17 @@ func (s StrSet) Itemv() []string { ...@@ -491,11 +491,17 @@ func (s StrSet) Itemv() []string {
// tool - it should not prevent from regenerating. // tool - it should not prevent from regenerating.
// - generated code imports packages which might be not there // - generated code imports packages which might be not there
// yet in gopath (lab.nexedi.com/kirr/go123/tracing) // yet in gopath (lab.nexedi.com/kirr/go123/tracing)
func findPackageNoZTrace(ctxt *build.Context, fromDir, importPath string, mode build.ImportMode) (*build.Package, error) { func findPackageNoZTrace(ctxt *build.Context, importPath, fromDir string, mode build.ImportMode) (*build.Package, error) {
fmt.Println("AAA", importPath)
bp, err := ctxt.Import(importPath, fromDir, mode) bp, err := ctxt.Import(importPath, fromDir, mode)
//fmt.Println()
//fmt.Println("BBB")
//fmt.Println(bp)
//fmt.Println(err)
//fmt.Println()
filter := func(filev *[]string) { filter := func(filev *[]string) {
okv := []string{} var okv []string
for _, f := range *filev { for _, f := range *filev {
if strings.HasPrefix(f, "ztrace") { if strings.HasPrefix(f, "ztrace") {
bp.IgnoredGoFiles = append(bp.IgnoredGoFiles, f) bp.IgnoredGoFiles = append(bp.IgnoredGoFiles, f)
...@@ -516,6 +522,12 @@ func findPackageNoZTrace(ctxt *build.Context, fromDir, importPath string, mode b ...@@ -516,6 +522,12 @@ func findPackageNoZTrace(ctxt *build.Context, fromDir, importPath string, mode b
// XXX also adjust .Import{s,Pos}, .TestImport{s,Pos}, .XTestImport{s,Pos} ? // XXX also adjust .Import{s,Pos}, .TestImport{s,Pos}, .XTestImport{s,Pos} ?
} }
//fmt.Println()
//fmt.Println("CCC")
//fmt.Println(bp)
//fmt.Println(err)
//fmt.Println()
//panic(0)
return bp, err return bp, err
} }
......
...@@ -133,7 +133,7 @@ func TestGoTraceGen(t *testing.T) { ...@@ -133,7 +133,7 @@ func TestGoTraceGen(t *testing.T) {
} }
// XXX autodetect (go list ?) // XXX autodetect (go list ?)
testv := []string{"a/pkg1", "b/pkg2", "c/pkg3"} testv := []string{"a/pkg1"} // XXX , "b/pkg2", "c/pkg3"}
for _, tpkg := range testv { for _, tpkg := range testv {
err = tracegen(tpkg, tBuildCtx, "" /* = local imorts disabled */) err = tracegen(tpkg, tBuildCtx, "" /* = local imorts disabled */)
......
// Code generated by lab.nexedi.com/kirr/go123/tracing/cmd/gotrace; DO NOT EDIT. // Code generated by lab.nexedi.com/kirr/go123/tracing/cmd/gotrace; DO NOT EDIT.
package pkg1
import (
"non-existent"
)
Bad bad bad - I'm invalid go file. Bad bad bad - I'm invalid go file.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment