Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
neoppod
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Levin Zimmermann
neoppod
Commits
799f09aa
Commit
799f09aa
authored
Jul 03, 2017
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
469c1316
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
go/xcommon/tracing/cmd/gotrace/gotrace.go
go/xcommon/tracing/cmd/gotrace/gotrace.go
+14
-2
go/xcommon/tracing/cmd/gotrace/gotrace_test.go
go/xcommon/tracing/cmd/gotrace/gotrace_test.go
+1
-1
go/xcommon/tracing/cmd/gotrace/testdata/src/a/pkg1/ztrace.go
go/xcommon/tracing/cmd/gotrace/testdata/src/a/pkg1/ztrace.go
+6
-0
No files found.
go/xcommon/tracing/cmd/gotrace/gotrace.go
View file @
799f09aa
...
@@ -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
}
}
...
...
go/xcommon/tracing/cmd/gotrace/gotrace_test.go
View file @
799f09aa
...
@@ -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 */
)
...
...
go/xcommon/tracing/cmd/gotrace/testdata/src/a/pkg1/ztrace.go
View file @
799f09aa
// 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
.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment