Commit 9081392f authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 219e1ced
package pkg1
import (
"net/url"
// extra import which is used in package but should not be used in tracing
"fmt"
)
// probe receives no args
//trace:event traceNewTPre()
// probe receives type this package defines
//trace:event traceNewT(t *T)
type T struct {}
func NewT() *T {
traceNewTPre()
t := &T{}
traceNewT(t)
return t
}
// probe receives type from another package
//trace:event traceURLParsed(u *url.URL)
func ParseURL(ustr string) (*url.URL, error) {
u, err := url.Parse(ustr)
if err != nil {
return nil, fmt.Errorf("oh my bad: %v", err)
}
traceURLParsed(u)
return u, nil
}
// probe receives builtin type
//trace:event traceDoSomething(topic string)
func DoSomething(topic string) {
traceDoSomething(topic)
}
package pkg2
import "a/pkg1" // TODO should not be needed eventually
//trace:import a/pkg1
//trace:event DoSomething(i, j int, q string)
func DoSomething(i, j int, q string) {
traceDoSomething(i, j, q)
}
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